make sure magic bytes are read fully

This commit is contained in:
Dave Brosius 2013-05-10 23:16:25 -04:00
parent a5507afb6e
commit c48ab66e99
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ public class SnappyCodec
public static SnappyCodec readHeader(InputStream in) throws IOException {
DataInputStream d = new DataInputStream(in);
byte[] magic = new byte[MAGIC_LEN];
d.read(magic, 0, MAGIC_LEN);
d.readFully(magic, 0, MAGIC_LEN);
int version = d.readInt();
int compatibleVersion = d.readInt();
return new SnappyCodec(magic, version, compatibleVersion);