class ThrottledInputStream extends InputStream {

  @Override
  public int read() throws IOException {
    throttle();
    int data = rawStream.read();
    if (data != -1) {
      bytesRead++;
    }
    return data;
  }

  public  ThrottledInputStream(InputStream rawStream);
  public  ThrottledInputStream(InputStream rawStream, long maxBytesPerSec);

}