protected WsByteBufferImpl allocateBufferDirect ( WsByteBufferImpl buffer , int size , boolean overrideRefCount ) { DirectByteBufferHelper directByteBufferHelper = this . directByteBufferHelper . get ( ) ; ByteBuffer byteBuffer ; if ( directByteBufferHelper != null ) { byteBuffer = directByteBufferHelper . allocateDirectByteBuffer ( size ) ; } else { byteBuffer = ByteBuffer . allocateDirect ( size ) ; } buffer . setByteBufferNonSafe ( byteBuffer ) ; return buffer ; }
Allocate the direct ByteBuffer that will be wrapped by the input WsByteBuffer object .