Skip to content

Commit

Permalink
Avoid over-allocating a buffer (#70 and #89)
Browse files Browse the repository at this point in the history
  • Loading branch information
odaira committed May 24, 2017
1 parent 2b1d5ef commit c8f4371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/java/net/jpountz/lz4/LZ4BlockInputStream.java
Expand Up @@ -186,7 +186,7 @@ private void refill() throws IOException {
readFully(buffer, originalLen);
break;
case COMPRESSION_METHOD_LZ4:
if (compressedBuffer.length < originalLen) {
if (compressedBuffer.length < compressedLen) {
compressedBuffer = new byte[Math.max(compressedLen, compressedBuffer.length * 3 / 2)];
}
readFully(compressedBuffer, compressedLen);
Expand Down

0 comments on commit c8f4371

Please sign in to comment.