protected WsByteBuffer getBuffer() {
        WsByteBuffer buffer = this.output[this.outputIndex];
        if (null == buffer) {
            buffer = HttpDispatcher.getBufferManager().allocate(this.bbSize);
            buffer.clear();
            this.output[this.outputIndex] = buffer;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "getBuffer, buffer -->" + buffer + " ,outputIndex -->" + this.outputIndex);
            }
        } else if (!buffer.hasRemaining()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "getBuffer, buffer  -->" + buffer + " ,outputIndex -->" + this.outputIndex + " output length -->" + this.output.length);
            }
            buffer.flip();
            this.outputIndex++;
            // next array spot may or may not exist from previous iterations
            if (null == this.output[this.outputIndex]) {
                this.output[this.outputIndex] = HttpDispatcher.getBufferManager().allocate(this.bbSize);
            }
            buffer = this.output[this.outputIndex];
            buffer.clear();
        }
        return buffer;
    }
protected WsByteBuffer getBuffer ( ) { WsByteBuffer buffer = this . output [ this . outputIndex ] ; if ( null == buffer ) { buffer = HttpDispatcher . getBufferManager ( ) . allocate ( this . bbSize ) ; buffer . clear ( ) ; this . output [ this . outputIndex ] = buffer ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getBuffer, buffer -->" + buffer + " ,outputIndex -->" + this . outputIndex ) ; } } else if ( ! buffer . hasRemaining ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getBuffer, buffer  -->" + buffer + " ,outputIndex -->" + this . outputIndex + " output length -->" + this . output . length ) ; } buffer . flip ( ) ; this . outputIndex ++ ; if ( null == this . output [ this . outputIndex ] ) { this . output [ this . outputIndex ] = HttpDispatcher . getBufferManager ( ) . allocate ( this . bbSize ) ; } buffer = this . output [ this . outputIndex ] ; buffer . clear ( ) ; } return buffer ; }
Access the proper output buffer for the current write attempt.

@return WsByteBuffer