code: @Override
    public int read(byte[] b, int off, int len) throws IOException {
      int bytes = inner.read(b, off, Math.min(len, remaining));
      if (bytes > 0) {
        remaining -= bytes;
      }
      return bytes;
    }
docs: /* (non-Javadoc)
  @see java.io.InputStream#read(byte[], int, int)