@Override
    public WsByteBuffer[] marshallBinaryHeaders(WsByteBuffer[] src) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "marshallBinaryHeaders");
        }

        preMarshallHeaders();
        WsByteBuffer[] buffers = src;
        if (null == buffers) {
            buffers = new WsByteBuffer[1];
            buffers[0] = allocateBuffer(this.outgoingHdrBufferSize);
            this.bytePosition = 0;
        }

        HeaderElement elem = this.hdrSequence;
        while (null != elem) {
            buffers = marshallBinaryHeader(buffers, elem);
            elem = elem.nextSequence;
        }

        buffers = putInt(GenericConstants.END_OF_HEADERS, buffers);
        buffers = flushCache(buffers);

        // flip the last buffer now that we're done
        buffers[buffers.length - 1].flip();
        postMarshallHeaders();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "marshallBinaryHeaders");
        }
        return buffers;
    }
@ Override public WsByteBuffer [ ] marshallBinaryHeaders ( WsByteBuffer [ ] src ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "marshallBinaryHeaders" ) ; } preMarshallHeaders ( ) ; WsByteBuffer [ ] buffers = src ; if ( null == buffers ) { buffers = new WsByteBuffer [ 1 ] ; buffers [ 0 ] = allocateBuffer ( this . outgoingHdrBufferSize ) ; this . bytePosition = 0 ; } HeaderElement elem = this . hdrSequence ; while ( null != elem ) { buffers = marshallBinaryHeader ( buffers , elem ) ; elem = elem . nextSequence ; } buffers = putInt ( GenericConstants . END_OF_HEADERS , buffers ) ; buffers = flushCache ( buffers ) ; buffers [ buffers . length - 1 ] . flip ( ) ; postMarshallHeaders ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "marshallBinaryHeaders" ) ; } return buffers ; }
@see com.ibm.wsspi.genericbnf.BNFHeaders#marshallBinaryHeaders(WsByteBuffer[])