org.apache.avro.util
Class ByteBufferInputStream
java.lang.Object
java.io.InputStream
org.apache.avro.util.ByteBufferInputStream
- All Implemented Interfaces:
- Closeable
public class ByteBufferInputStream
- extends InputStream
Utility to present ByteBuffer
data as an InputStream
.
Method Summary |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
ByteBuffer |
readBuffer(int length)
Read a buffer from the input without copying, if possible. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteBufferInputStream
public ByteBufferInputStream(List<ByteBuffer> buffers)
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
EOFException
- if EOF is reached.
IOException
- See Also:
InputStream.read()
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
EOFException
- if EOF is reached before reading all the bytes.
IOException
- See Also:
InputStream.read(byte[], int, int)
readBuffer
public ByteBuffer readBuffer(int length)
throws IOException
- Read a buffer from the input without copying, if possible.
- Throws:
EOFException
- if EOF is reached before reading all the bytes.
IOException
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.