@Override
  public int read() throws IOException {
    if (pos >= limit) {
      return -1;
    }
    int result = in.read();
    if (result < 0) {
      return -1;
    }
    pos++;
    return result;
  }
This class is only used by WAL ValueCompressor for decompression.
<p>
<strong>WARNING: </strong>The implementation is very tricky and does not follow typical
InputStream pattern, so do not use it in any other places.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALDecompressionBoundedDelegatingInputStream.java