mirror of
https://github.com/xerial/snappy-java.git
synced 2025-06-01 04:30:17 +02:00
Read until all bytes needed are read or EOF
https://github.com/xerial/snappy-java/issues/62
This commit is contained in:
parent
fb8cf734c9
commit
146d6e989f
@ -136,9 +136,7 @@ public final class SnappyFramedInputStream extends InputStream implements
|
||||
final byte[] actualHeader = new byte[expectedHeader.length];
|
||||
final ByteBuffer actualBuffer = ByteBuffer.wrap(actualHeader);
|
||||
|
||||
// assume that if the input cannot read 4 bytes that something is
|
||||
// wrong.
|
||||
final int read = in.read(actualBuffer);
|
||||
final int read = SnappyFramed.readBytes(in, actualBuffer);
|
||||
if (read < expectedHeader.length) {
|
||||
throw new EOFException(
|
||||
"encountered EOF while reading stream header");
|
||||
|
Loading…
x
Reference in New Issue
Block a user