Code example for ByteArrayBuffer

Methods: buffer, clear, length

0
    public int available() { 
        return capacity() - length(); 
    } 
 
    protected void flushBuffer() throws IOException { 
        int len = this.buffer.length(); 
        if (len > 0) { 
            this.outstream.write(this.buffer.buffer(), 0, len); 
            this.buffer.clear(); 
            this.metrics.incrementBytesTransferred(len); 
        } 
    } 
 
    public void flush() throws IOException { 
        flushBuffer(); 
        this.outstream.flush(); 
    } 
 
    public void write(final byte[] b, int off, int len) throws IOException { 
        if (b == null) { 
            return;