class LimitedInputStream extends FilterInputStream {

  @Override
  public int read() throws IOException {
    if (read(ONE_BYTE, 0, 1) == 1) {
      return ONE_BYTE[0];
    }
    return -1;
  }

  public  LimitedInputStream(InputStream in, long numToRead);

}