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
I think that the loop should be something like:
for (int i=0; i
Since streams are 0 based.
Also, you might want to keep reading until you hit the EOF rather than reading a specific number of bytes. See this tutorial to learn how :)