QuickServer
v1.4.7

org.quickserver.util.io
Class ByteBufferOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.quickserver.util.io.ByteBufferOutputStream

public class ByteBufferOutputStream
extends java.io.OutputStream

This is an OutputStream constructed from list of ByteBuffers. This is used in non-blocking mode.

Since:
1.4.5
Author:
Akshathkumar Shetty

Constructor Summary
ByteBufferOutputStream(java.util.ArrayList bufferList, ClientHandler handler)
          Creates a new ByteBufferOutputStream using the given list as its base and ClientHandler as the target channel.
 
Method Summary
 void close()
           
 void flush()
           
 void forceNotify()
           
 boolean isDataAvailableForWrite(java.lang.Object toNotify)
           
static boolean isLoggable(java.util.logging.Level level)
           
static void setDebug(boolean flag)
          Sets the debug flag.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 boolean writeAllByteBuffer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferOutputStream

public ByteBufferOutputStream(java.util.ArrayList bufferList,
                              ClientHandler handler)
Creates a new ByteBufferOutputStream using the given list as its base and ClientHandler as the target channel.

Method Detail

setDebug

public static void setDebug(boolean flag)
Sets the debug flag. When debug is set to true one can see number of bytes written.


isLoggable

public static boolean isLoggable(java.util.logging.Level level)
Since:
1.4.7

close

public void close()

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

writeAllByteBuffer

public boolean writeAllByteBuffer()
                           throws java.io.IOException
Throws:
java.io.IOException

forceNotify

public void forceNotify()

isDataAvailableForWrite

public boolean isDataAvailableForWrite(java.lang.Object toNotify)

QuickServer
v1.4.7

Copyright © 2003-2006 QuickServer.org