relates to - masked byte data for lookahead
@@ -103,12 +103,15 @@ else if (len == 0)
int bufferTail = bytesRead - bytesFromLookahead;
for (int i = bufferTail; i < bytesRead; i++)
{
- lookAhead[bufPtr] = readBuffer[i];
+ lookAhead[bufPtr] = readBuffer[i] & 0xff; // we're not at end of file.
bufPtr = (bufPtr + 1) % lookAhead.length;
}
// Copy head of readBuffer to output
+ if (bufferTail != 0)
+ {
System.arraycopy(readBuffer, 0, b, off + bytesFromLookahead, bufferTail);
+ }
return bytesRead;
}
