com.sun.grizzly.util
Class OutputWriter

java.lang.Object
  extended by com.sun.grizzly.util.OutputWriter

public class OutputWriter
extends Object

NIO utility to flush ByteBuffer

Author:
Scott Oaks

Constructor Summary
OutputWriter()
           
 
Method Summary
static long flushChannel(DatagramChannel datagramChannel, SocketAddress socketAddress, ByteBuffer bb)
          Flush the buffer by looping until the ByteBuffer is empty
static long flushChannel(DatagramChannel datagramChannel, SocketAddress socketAddress, ByteBuffer bb, long writeTimeout)
          Flush the buffer by looping until the ByteBuffer is empty
static long flushChannel(SelectableChannel channel, ByteBuffer bb)
          Flush the buffer by looping until the ByteBuffer is empty
static long flushChannel(SelectableChannel channel, ByteBuffer bb, long writeTimeout)
          Flush the buffer by looping until the ByteBuffer is empty
static long flushChannel(SocketChannel socketChannel, ByteBuffer[] bb)
          Flush the buffer by looping until the ByteBuffer is empty
static long flushChannel(SocketChannel socketChannel, ByteBuffer[] bb, long writeTimeout)
          Flush the buffer by looping until the ByteBuffer is empty
static int getDefaultWriteTimeout()
           
static void setDefaultWriteTimeout(int aDefaultWriteTimeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputWriter

public OutputWriter()
Method Detail

flushChannel

public static long flushChannel(SelectableChannel channel,
                                ByteBuffer bb)
                         throws IOException
Flush the buffer by looping until the ByteBuffer is empty

Parameters:
channel - SelectableChannel
bb - the ByteBuffer to write.
Returns:
Throws:
IOException

flushChannel

public static long flushChannel(SelectableChannel channel,
                                ByteBuffer bb,
                                long writeTimeout)
                         throws IOException
Flush the buffer by looping until the ByteBuffer is empty

Parameters:
channel - SelectableChannel
bb - the ByteBuffer to write.
writeTimeout -
Returns:
Throws:
IOException

flushChannel

public static long flushChannel(SocketChannel socketChannel,
                                ByteBuffer[] bb)
                         throws IOException
Flush the buffer by looping until the ByteBuffer is empty

Parameters:
socketChannel - SocketChannel
bb - the ByteBuffer to write.
Returns:
Throws:
IOException

flushChannel

public static long flushChannel(SocketChannel socketChannel,
                                ByteBuffer[] bb,
                                long writeTimeout)
                         throws IOException
Flush the buffer by looping until the ByteBuffer is empty

Parameters:
socketChannel - SocketChannel
bb - the ByteBuffer to write.
writeTimeout -
Returns:
Throws:
IOException

flushChannel

public static long flushChannel(DatagramChannel datagramChannel,
                                SocketAddress socketAddress,
                                ByteBuffer bb)
                         throws IOException
Flush the buffer by looping until the ByteBuffer is empty

Parameters:
datagramChannel -
socketAddress -
bb - the ByteBuffer to write.
Returns:
Throws:
IOException

flushChannel

public static long flushChannel(DatagramChannel datagramChannel,
                                SocketAddress socketAddress,
                                ByteBuffer bb,
                                long writeTimeout)
                         throws IOException
Flush the buffer by looping until the ByteBuffer is empty

Parameters:
datagramChannel -
socketAddress -
bb - the ByteBuffer to write.
writeTimeout -
Returns:
Throws:
IOException

getDefaultWriteTimeout

public static int getDefaultWriteTimeout()

setDefaultWriteTimeout

public static void setDefaultWriteTimeout(int aDefaultWriteTimeout)


Copyright © 2012 Oracle Corporation. All Rights Reserved.