Hello, I would like to send a raw array of bytes using a socket's output stream. How do I accomplish this, and similarly, how do I retrieve the same array of bytes using a socket's input stream?
Something like this:
String IPaddress = "25.25.67.89";
Socket socket = new Socket(IPAddress, 2345);
byte[] bytes = new byte[4];
String[] split = IPaddress.split("\\.");
for(int i = 0; i < split.length; ++i){
Integer value = new Integer(Integer.parseInt(split));
bytes[i] = value.byteValue();
}
// OutputStream os = socket.getOutputStream();
// How do I write the byte array to the outputstream?