Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to send a byte array in socket java

byte[] message = ...
Socket socket = ...
DataOutputStream dOut = new DataOutputStream(socket.getOutputStream());

dOut.writeInt(message.length); // write length of the message
dOut.write(message);           // write the message
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #send #byte #array #socket #java
ADD COMMENT
Topic
Name
1+1 =