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 TypeMethodDescriptionvoidsetByteBuffer(ByteBuffer byteBuffer) voidwrite(byte[] bytes, int offset, int length) voidwrite(int b) Methods inherited from class 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:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-