Package net.morimekta.util.io
Class ByteBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- net.morimekta.util.io.ByteBufferInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ByteBufferInputStream extends java.io.InputStream
Simple input stream backed by a byte buffer.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInputStream(java.nio.ByteBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mark(int i)
boolean
markSupported()
int
read()
int
read(byte[] bytes)
int
read(byte[] bytes, int off, int len)
void
reset()
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(@Nonnull byte[] bytes) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(@Nonnull byte[] bytes, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
-
mark
public void mark(int i)
- Overrides:
mark
in classjava.io.InputStream
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-