While doing some testing I found a bug in my code that was related to how read byte[] will only return to the end of the current decompressed buffer. It was easier in this case to modify the LZ4BlockInputStream to refill and continue to load the buffer. Feel free to integrate if you like.
` @overide
public int read(byte[] b, int off, int len) throws IOException {
SafeUtils.checkRange(b, off, len);
if (finished) {
return -1;
}
int bytesRead = 0;
int remaining = originalLen - o;
while (len >= remaining) {
System.arraycopy(buffer, o, b, off, remaining);
o += remaining;
len -= remaining;
off += remaining;
bytesRead += remaining;
refill();
if (finished) {
return bytesRead;
}
remaining = originalLen - o;
}
System.arraycopy(buffer, o, b, off, len);
bytesRead += len;
o += len;
return bytesRead;
}
While doing some testing I found a bug in my code that was related to how read byte[] will only return to the end of the current decompressed buffer. It was easier in this case to modify the LZ4BlockInputStream to refill and continue to load the buffer. Feel free to integrate if you like.
` @overide
``