org.openqa.jetty.http.nio
Class ByteBufferInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.openqa.jetty.http.nio.ByteBufferInputStream
All Implemented Interfaces:
java.io.Closeable

public class ByteBufferInputStream
extends java.io.InputStream

Version:
$Revision: 1.5 $
Author:
gregw

Constructor Summary
ByteBufferInputStream(int bufferSize)
          Constructor.
 
Method Summary
 int available()
           
 void close()
           
 void destroy()
           
 java.nio.ByteBuffer getBuffer()
          Get a buffer to write to this InputStream.
 long getTimeout()
          getSoTimeout.
 void mark(int arg0)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buf)
           
 int read(byte[] buf, int offset, int length)
           
 void recycle(java.nio.ByteBuffer buf)
           
 void reset()
           
 void setTimeout(long l)
          setSoTimeout.
 long skip(long length)
           
 void write(java.nio.ByteBuffer buffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferInputStream

public ByteBufferInputStream(int bufferSize)
Constructor.

Method Detail

getTimeout

public long getTimeout()
getSoTimeout.

Returns:

setTimeout

public void setTimeout(long l)
setSoTimeout.

Parameters:
l -

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

mark

public void mark(int arg0)
Overrides:
mark in class java.io.InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.InputStream

read

public int read(byte[] buf,
                int offset,
                int length)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] buf)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException

skip

public long skip(long length)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.skip(long)

write

public void write(java.nio.ByteBuffer buffer)

getBuffer

public java.nio.ByteBuffer getBuffer()
Get a buffer to write to this InputStream. The buffer wll either be a new direct buffer or a recycled buffer.


recycle

public void recycle(java.nio.ByteBuffer buf)

destroy

public void destroy()


Copyright © 2011. All Rights Reserved.