com.danga.MemCached
Class ByteBufArrayInputStream
java.lang.Object
java.io.InputStream
com.danga.MemCached.ByteBufArrayInputStream
- All Implemented Interfaces:
- LineInputStream, java.io.Closeable
public final class ByteBufArrayInputStream
- extends java.io.InputStream
- implements LineInputStream
Field Summary |
private java.nio.ByteBuffer[] |
bufs
|
private int |
currentBuf
|
Method Summary |
void |
clearEOL()
Read everything up to and including the end of line. |
int |
read()
|
int |
read(byte[] buf)
Read some bytes. |
java.lang.String |
readLine()
Read everything up to the next end-of-line. |
java.lang.String |
toString()
|
Methods inherited from class java.io.InputStream |
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
bufs
private java.nio.ByteBuffer[] bufs
currentBuf
private int currentBuf
ByteBufArrayInputStream
public ByteBufArrayInputStream(java.util.List<java.nio.ByteBuffer> bufs)
throws java.lang.Exception
- Throws:
java.lang.Exception
ByteBufArrayInputStream
public ByteBufArrayInputStream(java.nio.ByteBuffer[] bufs)
throws java.lang.Exception
- Throws:
java.lang.Exception
read
public int read()
- Specified by:
read
in class java.io.InputStream
read
public int read(byte[] buf)
- Description copied from interface:
LineInputStream
- Read some bytes.
- Specified by:
read
in interface LineInputStream
- Overrides:
read
in class java.io.InputStream
- Parameters:
buf
- The buffer into which read.
- Returns:
- The number of bytes actually read, or -1 if none could be read.
readLine
public java.lang.String readLine()
throws java.io.IOException
- Description copied from interface:
LineInputStream
- Read everything up to the next end-of-line. Does
not include the end of line, though it is consumed
from the input.
- Specified by:
readLine
in interface LineInputStream
- Returns:
- All next up to the next end of line.
- Throws:
java.io.IOException
clearEOL
public void clearEOL()
throws java.io.IOException
- Description copied from interface:
LineInputStream
- Read everything up to and including the end of line.
- Specified by:
clearEOL
in interface LineInputStream
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright ? 2005 - greg whalin