class CountingInputStream extends ProxyInputStream {

    public int getCount() {
        final long result = getByteCount();
        if (result > Integer.MAX_VALUE) {
            throw new ArithmeticException("The byte count " + result + " is too large to be converted to an int");
        }
        return (int) result;
    }

    public  CountingInputStream(final InputStream in);

}