how to send an array of bytes over a TCP connection (java programming)

前端 未结 9 1747
粉色の甜心
粉色の甜心 2020-12-13 14:45

Can somebody demonstrate how to send an array of bytes over a TCP connection from a sender program to a receiver program in Java.

byte[] myByteArray
<         


        
9条回答
  •  天涯浪人
    2020-12-13 15:04

    The Oracle Socket Communications Tutorial would seem to be the appropriate launch point.

    Note that it's going to extra trouble to turn characters into bytes. If you want to work at the byte level, just peel that off.

提交回复
热议问题