@Override
    protected boolean readAtOffset(FSDataInputStream istream, ByteBuff dest, int size,
      boolean peekIntoNextBlock, long fileOffset, boolean pread) throws IOException {
      int destOffset = dest.position();
      boolean returnValue =
        super.readAtOffset(istream, dest, size, peekIntoNextBlock, fileOffset, pread);
      if (!corruptDataStream) {
        return returnValue;
      }
      // Corrupt 3rd character of block magic of next block's header.
      if (peekIntoNextBlock) {
        dest.put(destOffset + size + 3, (byte) 0b00000000);
      }
      // We might be reading this block's header too, corrupt it.
      dest.put(destOffset + 1, (byte) 0b00000000);
      // Corrupt non header data
      if (size > hdrSize) {
        dest.put(destOffset + hdrSize + 1, (byte) 0b00000000);
      }
      return returnValue;
    }
If set to true, corrupt reads using readAtOffset(...).
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestChecksum.java