Looking at your code i can't see a reason why you
would be getting an incorrect reading.
The bytes read should match what the
public long length() method is returning.
What about where you are reading? Maybe the
problem is there.