Package com.danga.MemCached
Class ByteBufArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.danga.MemCached.ByteBufArrayInputStream
-
- All Implemented Interfaces:
LineInputStream
,java.io.Closeable
,java.lang.AutoCloseable
public final class ByteBufArrayInputStream extends java.io.InputStream implements LineInputStream
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer[]
bufs
private int
currentBuf
-
Constructor Summary
Constructors Constructor Description ByteBufArrayInputStream(java.nio.ByteBuffer[] bufs)
ByteBufArrayInputStream(java.util.List<java.nio.ByteBuffer> bufs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
Constructor Detail
-
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
-
-
Method Detail
-
read
public int read()
- Specified by:
read
in classjava.io.InputStream
-
read
public int read(byte[] buf)
Description copied from interface:LineInputStream
Read some bytes.- Specified by:
read
in interfaceLineInputStream
- Overrides:
read
in classjava.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 interfaceLineInputStream
- 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 interfaceLineInputStream
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-