I\'m trying to download a file using socket and server in java.
myClient = new Socket(address,port); myClient.setSoTimeout(MyFileManager.TIME_OUT); in = ne
Why do you think that this line returns the number of bytes in the stream??
long size = in.readLong(); //get the size
You should do in.read() until it returns -1.
in.read()