byte[] getHeaderAndDataForTest() throws IOException {
      ensureBlockReady();
      // This is not very optimal, because we are doing an extra copy.
      // But this method is used only by unit tests.
      byte[] output = new byte[onDiskBlockBytesWithHeader.size() + onDiskChecksum.length];
      System.arraycopy(onDiskBlockBytesWithHeader.getBuffer(), 0, output, 0,
        onDiskBlockBytesWithHeader.size());
      System.arraycopy(onDiskChecksum, 0, output, onDiskBlockBytesWithHeader.size(),
        onDiskChecksum.length);
      return output;
    }
Returns the header or the compressed data (or uncompressed data when not using compression)
as a byte array. Can be called in the "writing" state or in the "block ready" state. If
called in the "writing" state, transitions the writer to the "block ready" state. This
returns the header + data + checksums stored on disk.
@return header and data as they would be stored on disk in a byte array
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java