Calling in.read() reads the byte, but your code does nothing with the read byte. If there is a byte read, you should do something with it:
byte firstByte = in.read();
if ( firstByte == -1 ){...
Type: Posts; User: copeg
Calling in.read() reads the byte, but your code does nothing with the read byte. If there is a byte read, you should do something with it:
byte firstByte = in.read();
if ( firstByte == -1 ){...
You are reading the first byte(s) of the file to check if it is empty or not. If not, you then start to read and write the file from that point on...in other words, your code skips the first bytes...