public class DirectBufferOutputStream
extends java.io.OutputStream
OutputStream
that wraps an underlying MutableDirectBuffer
.Constructor and Description |
---|
DirectBufferOutputStream() |
DirectBufferOutputStream(MutableDirectBuffer buffer) |
DirectBufferOutputStream(MutableDirectBuffer buffer,
int offset,
int length) |
Modifier and Type | Method and Description |
---|---|
MutableDirectBuffer |
buffer()
The underlying buffer being wrapped.
|
void |
close() |
int |
length()
The length of the underlying buffer to use
|
int |
offset()
The offset within the underlying buffer at which to start.
|
int |
position()
The position in the buffer from the offset up to which has been written.
|
void |
wrap(MutableDirectBuffer buffer) |
void |
wrap(MutableDirectBuffer buffer,
int offset,
int length) |
void |
write(byte[] srcBytes,
int srcOffset,
int length)
Write a byte[] to the buffer.
|
void |
write(int b)
Write a byte to buffer.
|
public DirectBufferOutputStream()
public DirectBufferOutputStream(MutableDirectBuffer buffer)
public DirectBufferOutputStream(MutableDirectBuffer buffer, int offset, int length)
public void wrap(MutableDirectBuffer buffer)
public void wrap(MutableDirectBuffer buffer, int offset, int length)
public int position()
public int offset()
public MutableDirectBuffer buffer()
public int length()
public void write(int b)
write
in class java.io.OutputStream
b
- to be written.java.lang.IllegalStateException
- if insufficient capacity remains in the buffer.public void write(byte[] srcBytes, int srcOffset, int length)
write
in class java.io.OutputStream
srcBytes
- to writesrcOffset
- at which to begin reading bytes from the srcBytes.length
- of the srcBytes to read.java.lang.IllegalStateException
- if insufficient capacity remains in the buffer.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.