public void readAndCheck(DataInputStream in) throws IOException {
    byte[] buf = new byte[MAGIC_LENGTH];
    in.readFully(buf);
    if (Bytes.compareTo(buf, magic) != 0) {
      throw new IOException("Invalid magic: expected " + Bytes.toStringBinary(magic) + ", got "
        + Bytes.toStringBinary(buf));
    }
  }
Reads a magic record of the length {@link #MAGIC_LENGTH} from the given stream and expects it
to match this block type.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockType.java