Top Description Fields Constructors Methods
org.glassfish.grizzly.nio.transport

public Class TCPNIOUtils

extends Object
Class Inheritance
Imports
java.io.EOFException, .IOException, java.nio.ByteBuffer, java.nio.channels.SocketChannel, java.util.logging.Level, .Logger, org.glassfish.grizzly.Buffer, org.glassfish.grizzly.memory.BufferArray, .Buffers, .ByteBufferArray, .CompositeBuffer, .MemoryManager, org.glassfish.grizzly.nio.DirectByteBufferRecord, org.glassfish.grizzly.utils.Exceptions

TCP NIO Transport utils
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
pack-priv static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Buffer
private static int
calcWriteBufferSize(final TCPNIOConnection connection, final int bufferSize)

private static void
fill(Buffer src, int size, ByteBuffer dstByteBuffer)

pack-priv static void
fill(final BufferArray bufferArray, final int totalBufferSize, final DirectByteBufferRecord ioRecord)

public static int
flushByteBuffer(final SocketChannel channel, final ByteBuffer byteBuffer)

public static int
flushByteBuffers(final SocketChannel channel, final ByteBuffer[] byteBuffer, final int firstBufferOffest, final int numberOfBuffers)

public static int
readBuffer(final TCPNIOConnection connection, final Buffer buffer)

public static int
readCompositeBuffer(final TCPNIOConnection connection, final CompositeBuffer buffer)

public static int
readSimpleBuffer(final TCPNIOConnection connection, final Buffer buffer)

private static int
readSimpleByteBuffer(final TCPNIOConnection tcpConnection, final ByteBuffer byteBuffer)

public static int
writeCompositeBuffer(final TCPNIOConnection connection, final CompositeBuffer buffer)

public static int
writeSimpleBuffer(final TCPNIOConnection connection, final Buffer buffer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
pack-priv static final Logger LOGGER

Constructor Detail

TCPNIOUtilsback to summary
public TCPNIOUtils()

Method Detail

allocateAndReadBufferback to summary
public static Buffer allocateAndReadBuffer(final TCPNIOConnection connection) throws IOException
calcWriteBufferSizeback to summary
private static int calcWriteBufferSize(final TCPNIOConnection connection, final int bufferSize)
fillback to summary
private static void fill(Buffer src, int size, ByteBuffer dstByteBuffer)
fillback to summary
pack-priv static void fill(final BufferArray bufferArray, final int totalBufferSize, final DirectByteBufferRecord ioRecord)
flushByteBufferback to summary
public static int flushByteBuffer(final SocketChannel channel, final ByteBuffer byteBuffer) throws IOException
flushByteBuffersback to summary
public static int flushByteBuffers(final SocketChannel channel, final ByteBuffer[] byteBuffer, final int firstBufferOffest, final int numberOfBuffers) throws IOException
readBufferback to summary
public static int readBuffer(final TCPNIOConnection connection, final Buffer buffer) throws IOException
readCompositeBufferback to summary
public static int readCompositeBuffer(final TCPNIOConnection connection, final CompositeBuffer buffer) throws IOException
readSimpleBufferback to summary
public static int readSimpleBuffer(final TCPNIOConnection connection, final Buffer buffer) throws IOException
readSimpleByteBufferback to summary
private static int readSimpleByteBuffer(final TCPNIOConnection tcpConnection, final ByteBuffer byteBuffer) throws IOException
writeCompositeBufferback to summary
public static int writeCompositeBuffer(final TCPNIOConnection connection, final CompositeBuffer buffer) throws IOException
writeSimpleBufferback to summary
public static int writeSimpleBuffer(final TCPNIOConnection connection, final Buffer buffer) throws IOException