Analogously to how you sent that image. Simply use an InputStream
object like this:
InputStream stream = socket.getInputStream();
byte[] data = new byte[MAX_SIZE];
int count = stream.read(data);
Both objects (sending and receiving) are compatible this way, you just have to know the byte
array size, it has to be the same on both places.