Package org.fressian.impl
Class ByteBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.fressian.impl.ByteBufferInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ByteBufferInputStream extends java.io.InputStream
InputStream
over aByteBuffer
. Duplicates the buffer on construction in order to maintain its own cursor.- See Also:
InputStream
,ByteBuffer
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInputStream(java.nio.ByteBuffer buf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] bytes, int off, int len)
void
reset()
long
skip(long l)
-
-
-
Method Detail
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] bytes, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
skip
public long skip(long l) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-