protected WsByteBuffer [ ] flushCache ( WsByteBuffer [ ] buffers ) { // PK13351 - use the offset/length version to write only what we need // to and avoid the extra memory allocation int pos = this . bytePosition ; if ( 0 == pos ) { // nothing to write return buffers ; } this . bytePosition = 0 ; return GenericUtils . putByteArray ( buffers , this . byteCache , 0 , pos , this ) ; }
Method to flush whatever is in the cache into the input buffers . These buffers are then returned to the caller as the flush may have needed to expand the list .