class CharSequenceInputStream extends InputStream {

    @Override
    public int available() throws IOException {
        // The cached entries are in bbuf; since encoding always creates at least one byte
        // per character, we can add the two to get a better estimate (e.g. if bbuf is empty)
        // Note that the previous implementation (2.4) could return zero even though there were
        // encoded bytes still available.
        return this.bbuf.remaining() + this.cbuf.remaining();
    }

    public  CharSequenceInputStream(final CharSequence cs, final Charset charset, final int bufferSize);
    public  CharSequenceInputStream(final CharSequence cs, final String charset, final int bufferSize);
    public  CharSequenceInputStream(final CharSequence cs, final Charset charset);
    public  CharSequenceInputStream(final CharSequence cs, final String charset);

}