mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-21 04:54:33 +02:00
Fixes issue 9. The cause of slow-performance in streaming mode was default buffer size 8MB. When I changed it from 8MB to 8KB, the decompression (stream) performance was improved.
This commit is contained in:
parent
b694432815
commit
e77174e041
@ -84,7 +84,7 @@ public class SnappyInputStream extends InputStream
|
||||
|
||||
protected void readFully(byte[] fragment, int fragmentLength) throws IOException {
|
||||
// read the entire input data to the buffer
|
||||
compressed = new byte[Math.max(SnappyOutputStream.DEFAULT_BLOCK_SIZE, fragmentLength)];
|
||||
compressed = new byte[Math.max(8 * 1024, fragmentLength)]; // 8K
|
||||
System.arraycopy(fragment, 0, compressed, 0, fragmentLength);
|
||||
int cursor = fragmentLength;
|
||||
for (int readBytes = 0; (readBytes = in.read(compressed, cursor, compressed.length - cursor)) != -1;) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user