private static void skipBuffer(FSDataInputStream in, byte v) throws IOException {
    byte[] data = new byte[8192];
    try {
      int n;
      while ((n = in.read(data)) == data.length) {
        for (int i = 0; i < data.length; ++i) {
          if (data[i] != v) throw new Exception("File changed");
        }
      }
    } catch (Exception e) {
    }
  }
Verify that all bytes in 'data' have 'v' as value.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java