Package org.glassfish.grizzly.nio

Examples of org.glassfish.grizzly.nio.DirectByteBufferRecord.allocate()


            final int bufferSize = calcWriteBufferSize(connection, buffer.remaining());
            buffer.limit(oldPos + bufferSize);
           
            final DirectByteBufferRecord ioRecord =
                    DirectByteBufferRecord.get();
            final ByteBuffer directByteBuffer = ioRecord.allocate(bufferSize);
            fill(buffer, bufferSize, directByteBuffer);
           
            try {
                written = flushByteBuffer(socketChannel, directByteBuffer);
            } finally {
View Full Code Here


       
            if (!memoryManager.willAllocateDirect(receiveBufferSize)) {
                final DirectByteBufferRecord ioRecord =
                        DirectByteBufferRecord.get();
                final ByteBuffer directByteBuffer =
                        ioRecord.allocate(receiveBufferSize);
               
                try {
                    read = readSimpleByteBuffer(connection, directByteBuffer);
                    if (read > 0) {
                        directByteBuffer.flip();
View Full Code Here

    }

    public InputBufferWrapper prepare(final int size) {
        final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get();
        this.record = recordLocal;
        this.visible = recordLocal.allocate(size);
       
        return this;
    }

    @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.