it.unimi.dsi.io
Class ByteBufferInputStream
java.lang.Object
java.io.InputStream
it.unimi.dsi.fastutil.io.MeasurableInputStream
it.unimi.dsi.io.ByteBufferInputStream
- All Implemented Interfaces:
- RepositionableStream, Closeable
public class ByteBufferInputStream
- extends MeasurableInputStream
- implements RepositionableStream
A bridge between byte buffers and input streams.
The main usefulness of this class is that of making it possible creating input streams
that are really based on a MappedByteBuffer.
- Since:
- 1.2
- Author:
- Sebastiano Vigna
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteBufferInputStream
public ByteBufferInputStream(ByteBuffer byteBuffer)
- Creates a new byte-buffer input stream.
- Parameters:
byteBuffer - the underlying byte buffer.
available
public int available()
- Overrides:
available in class InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported in class InputStream
mark
public void mark(int unused)
- Overrides:
mark in class InputStream
reset
public void reset()
throws IOException
- Overrides:
reset in class InputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class InputStream
- Throws:
IOException
read
public int read()
- Specified by:
read in class InputStream
read
public int read(byte[] b,
int offset,
int length)
- Overrides:
read in class InputStream
length
public long length()
throws IOException
- Specified by:
length in class MeasurableInputStream
- Throws:
IOException
position
public long position()
throws IOException
- Specified by:
position in interface RepositionableStream- Specified by:
position in class MeasurableInputStream
- Throws:
IOException
position
public void position(long newPosition)
throws IOException
- Specified by:
position in interface RepositionableStream
- Throws:
IOException