public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
public InputBufferWrapper prepare(final int size) { final DirectByteBufferRecord recordLocal = DirectByteBufferRecord.get(); this.record = recordLocal; this.visible = recordLocal.allocate(size); return this; }
private int readNonConnected(final UDPNIOConnection connection, Buffer buffer, final ReadResult<Buffer, SocketAddress> currentResult) throws IOException { final SocketAddress peerAddress; final int read; final DirectByteBufferRecord ioRecord = DirectByteBufferRecord.get(); try { final ByteBuffer directByteBuffer = ioRecord.allocate(buffer.limit()); final int initialBufferPos = directByteBuffer.position(); peerAddress = ((DatagramChannel) connection.getChannel()).receive( directByteBuffer); read = directByteBuffer.position() - initialBufferPos; if (read > 0) { directByteBuffer.flip(); buffer.put(directByteBuffer); } } finally { ioRecord.release(); } final boolean hasRead = (read > 0); if (hasRead && currentResult != null) { currentResult.setMessage(buffer); currentResult.setReadSize(currentResult.getReadSize() + read); currentResult.setSrcAddress(peerAddress); } return read; }
private int readNonConnected(final UDPNIOConnection connection, Buffer buffer, final ReadResult<Buffer, SocketAddress> currentResult) throws IOException { final SocketAddress peerAddress; final int read; final DirectByteBufferRecord ioRecord = DirectByteBufferRecord.get(); try { final ByteBuffer directByteBuffer = ioRecord.allocate(buffer.limit()); final int initialBufferPos = directByteBuffer.position(); peerAddress = ((DatagramChannel) connection.getChannel()).receive( directByteBuffer); read = directByteBuffer.position() - initialBufferPos; if (read > 0) { directByteBuffer.flip(); buffer.put(directByteBuffer); } } finally { ioRecord.release(); } final boolean hasRead = (read > 0); if (hasRead && currentResult != null) { currentResult.setMessage(buffer); currentResult.setReadSize(currentResult.getReadSize() + read); currentResult.setSrcAddress(peerAddress); } return read; }
private int readNonConnected(final UDPNIOConnection connection, Buffer buffer, final ReadResult<Buffer, SocketAddress> currentResult) throws IOException { final SocketAddress peerAddress; final int read; final DirectByteBufferRecord ioRecord = DirectByteBufferRecord.get(); try { final ByteBuffer directByteBuffer = ioRecord.allocate(buffer.limit()); final int initialBufferPos = directByteBuffer.position(); peerAddress = ((DatagramChannel) connection.getChannel()).receive( directByteBuffer); read = directByteBuffer.position() - initialBufferPos; if (read > 0) { directByteBuffer.flip(); buffer.put(directByteBuffer); } } finally { ioRecord.release(); } final boolean hasRead = (read > 0); if (hasRead && currentResult != null) { currentResult.setMessage(buffer); currentResult.setReadSize(currentResult.getReadSize() + read); currentResult.setSrcAddress(peerAddress); } return read; }
private int readNonConnected(final UDPNIOConnection connection, Buffer buffer, final ReadResult<Buffer, SocketAddress> currentResult) throws IOException { final SocketAddress peerAddress; final int read; final DirectByteBufferRecord ioRecord = DirectByteBufferRecord.get(); try { final ByteBuffer directByteBuffer = ioRecord.allocate(buffer.limit()); final int initialBufferPos = directByteBuffer.position(); peerAddress = ((DatagramChannel) connection.getChannel()).receive( directByteBuffer); read = directByteBuffer.position() - initialBufferPos; if (read > 0) { directByteBuffer.flip(); buffer.put(directByteBuffer); } } finally { ioRecord.release(); } final boolean hasRead = (read > 0); if (hasRead && currentResult != null) { currentResult.setMessage(buffer); currentResult.setReadSize(currentResult.getReadSize() + read); currentResult.setSrcAddress(peerAddress); } return read; }
private int readNonConnected(final UDPNIOConnection connection, Buffer buffer, final ReadResult<Buffer, SocketAddress> currentResult) throws IOException { final SocketAddress peerAddress; final int read; final DirectByteBufferRecord ioRecord = DirectByteBufferRecord.get(); try { final ByteBuffer directByteBuffer = ioRecord.allocate(buffer.limit()); final int initialBufferPos = directByteBuffer.position(); peerAddress = ((DatagramChannel) connection.getChannel()).receive( directByteBuffer); read = directByteBuffer.position() - initialBufferPos; if (read > 0) { directByteBuffer.flip(); buffer.put(directByteBuffer); } } finally { ioRecord.release(); } final boolean hasRead = (read > 0); if (hasRead && currentResult != null) { currentResult.setMessage(buffer); currentResult.setReadSize(currentResult.getReadSize() + read); currentResult.setSrcAddress(peerAddress); } return read; }
private int readNonConnected(final UDPNIOConnection connection, Buffer buffer, final ReadResult<Buffer, SocketAddress> currentResult) throws IOException { final SocketAddress peerAddress; final int read; final DirectByteBufferRecord ioRecord = DirectByteBufferRecord.get(); try { final ByteBuffer directByteBuffer = ioRecord.allocate(buffer.limit()); final int initialBufferPos = directByteBuffer.position(); peerAddress = ((DatagramChannel) connection.getChannel()).receive( directByteBuffer); read = directByteBuffer.position() - initialBufferPos; if (read > 0) { directByteBuffer.flip(); buffer.put(directByteBuffer); } } finally { ioRecord.release(); } final boolean hasRead = (read > 0); if (hasRead && currentResult != null) { currentResult.setMessage(buffer); currentResult.setReadSize(currentResult.getReadSize() + read); currentResult.setSrcAddress(peerAddress); } return read; }
final ByteBuffer directByteBuffer = ioRecord.getDirectBuffer(); if (directByteBuffer == null) { ioRecord.allocate(totalRemaining); // allocate buffer big enough to put the entire message (not just the chunk we're writing)
final ByteBuffer directByteBuffer = ioRecord.getDirectBuffer(); if (directByteBuffer == null) { ioRecord.allocate(totalRemaining); // allocate buffer big enough to put the entire message (not just the chunk we're writing)