Package com.esotericsoftware.kryo.io
Class ByteBufferOutputStream
java.lang.Object
java.io.OutputStream
com.esotericsoftware.kryo.io.ByteBufferOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
An OutputStream whose target is a
ByteBuffer
. If bytes would be written that would overflow the buffer,
OutputStream.flush()
is called. Subclasses can override flush to empty the buffer.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an uninitialized stream that cannot be used untilsetByteBuffer(ByteBuffer)
is called.ByteBufferOutputStream
(int bufferSize) Creates a stream with a new non-direct buffer of the specified size.ByteBufferOutputStream
(ByteBuffer byteBuffer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
setByteBuffer
(ByteBuffer byteBuffer) void
write
(byte[] bytes, int offset, int length) void
write
(int b) Methods inherited from class java.io.OutputStream
close, flush, write
-
Field Details
-
byteBuffer
-
-
Constructor Details
-
ByteBufferOutputStream
public ByteBufferOutputStream()Creates an uninitialized stream that cannot be used untilsetByteBuffer(ByteBuffer)
is called. -
ByteBufferOutputStream
public ByteBufferOutputStream(int bufferSize) Creates a stream with a new non-direct buffer of the specified size. -
ByteBufferOutputStream
-
-
Method Details
-
getByteBuffer
-
setByteBuffer
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-