Skip to content

Commit

Permalink
relates to #1251 - masked byte data for lookahead
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Oct 24, 2022
1 parent 04bc509 commit 1f549b1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ 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
System.arraycopy(readBuffer, 0, b, off + bytesFromLookahead, bufferTail);

if (bufferTail != 0)
{
System.arraycopy(readBuffer, 0, b, off + bytesFromLookahead, bufferTail);
}

return bytesRead;
}

Expand Down

0 comments on commit 1f549b1

Please sign in to comment.