mirror of
https://github.com/xerial/snappy-java.git
synced 2025-07-01 19:24:32 +02:00
Fixes issue 23
This commit is contained in:
parent
36f0208eb1
commit
c675bf4280
@ -170,7 +170,13 @@ public class SnappyInputStream extends InputStream
|
|||||||
if (compressed == null || chunkSize > compressed.length) {
|
if (compressed == null || chunkSize > compressed.length) {
|
||||||
compressed = new byte[chunkSize];
|
compressed = new byte[chunkSize];
|
||||||
}
|
}
|
||||||
int readBytes = in.read(compressed, 0, chunkSize);
|
int readBytes = 0;
|
||||||
|
while (readBytes < chunkSize) {
|
||||||
|
int ret = in.read(compressed, readBytes, chunkSize - readBytes);
|
||||||
|
if (ret == -1)
|
||||||
|
break;
|
||||||
|
readBytes += ret;
|
||||||
|
}
|
||||||
if (readBytes < chunkSize) {
|
if (readBytes < chunkSize) {
|
||||||
throw new IOException("failed to read chunk");
|
throw new IOException("failed to read chunk");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user