org.openqa.jetty.http.nio
Class SocketChannelOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.openqa.jetty.http.nio.SocketChannelOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class SocketChannelOutputStream
extends OutputStream

Blocking output stream on non-blocking SocketChannel. Makes the assumption that writes will rarely need to block. All writes flush to the channel, and no additional buffering is done.

Version:
$Revision: 1.4 $
Author:
gregw

Constructor Summary
SocketChannelOutputStream(SocketChannel channel, int bufferSize)
          Constructor.
 
Method Summary
 void close()
           
 void destroy()
           
 void flush()
           
 void write(byte[] buf)
           
 void write(byte[] buf, int offset, int length)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketChannelOutputStream

public SocketChannelOutputStream(SocketChannel channel,
                                 int bufferSize)
Constructor.

Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

write

public void write(byte[] buf,
                  int offset,
                  int length)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] buf)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

destroy

public void destroy()


Copyright © 2012. All Rights Reserved.