Given the following pseudo code. how would I do read in the given data
Use DataInputStream to make your life easy.
DataInputStream in = new DataInputStream(socket.getInputStream()); short myShortStreamSize = in.readShort(); byte[] payload = new byte[myShortStreamSize]; in.readFully(payload);