Code example for ByteArrayBuffer

Methods: buffer, clear, length

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