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[]bufsprivate intcurrentBuf
-
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 voidclearEOL()Read everything up to and including the end of line.intread()intread(byte[] buf)Read some bytes.java.lang.StringreadLine()Read everything up to the next end-of-line.java.lang.StringtoString()
-
-
-
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:
readin classjava.io.InputStream
-
read
public int read(byte[] buf)
Description copied from interface:LineInputStreamRead some bytes.- Specified by:
readin interfaceLineInputStream- Overrides:
readin 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.IOExceptionDescription copied from interface:LineInputStreamRead everything up to the next end-of-line. Does not include the end of line, though it is consumed from the input.- Specified by:
readLinein interfaceLineInputStream- Returns:
- All next up to the next end of line.
- Throws:
java.io.IOException
-
clearEOL
public void clearEOL() throws java.io.IOExceptionDescription copied from interface:LineInputStreamRead everything up to and including the end of line.- Specified by:
clearEOLin interfaceLineInputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-