Package com.esotericsoftware.kryo.io
Class ByteBufferInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.esotericsoftware.kryo.io.ByteBufferInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ByteBufferInputStream extends InputStream
An InputStream whose source is aByteBuffer.- Author:
- Nathan Sweet
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInputStream()Creates an uninitialized stream that cannot be used untilsetByteBuffer(ByteBuffer)is called.ByteBufferInputStream(int bufferSize)Creates a stream with a new non-direct buffer of the specified size.ByteBufferInputStream(ByteBuffer byteBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()ByteBuffergetByteBuffer()intread()intread(byte[] bytes, int offset, int length)voidsetByteBuffer(ByteBuffer byteBuffer)-
Methods inherited from class java.io.InputStream
close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
ByteBufferInputStream
public ByteBufferInputStream()
Creates an uninitialized stream that cannot be used untilsetByteBuffer(ByteBuffer)is called.
-
ByteBufferInputStream
public ByteBufferInputStream(int bufferSize)
Creates a stream with a new non-direct buffer of the specified size. The position and limit of the buffer is zero.
-
ByteBufferInputStream
public ByteBufferInputStream(ByteBuffer byteBuffer)
-
-
Method Detail
-
getByteBuffer
public ByteBuffer getByteBuffer()
-
setByteBuffer
public void setByteBuffer(ByteBuffer byteBuffer)
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] bytes, int offset, int length) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
-