public class FixedByteArrayOutputStream extends java.io.OutputStream implements RandomAccessOutputStream
| Constructor and Description |
|---|
FixedByteArrayOutputStream(byte[] array,
int offset,
int length)
Creates a new instance of the FixedByteArrayOutputStream class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ByteArraySegment |
getData()
Returns a readonly ByteArraySegment wrapping this Stream's buffer.
|
int |
size()
Gets a value indicating the size of this OutputStream.
|
java.io.OutputStream |
subStream(int streamPosition,
int length)
Creates a new fixed-size OutputStream starting at the given position in this OutputStream and of the given length.
|
void |
write(byte[] buffer,
int bufferOffset,
int length,
int streamPosition)
Writes a sequence of bytes at the given position.
|
void |
write(int b) |
void |
write(int byteValue,
int streamPosition)
Writes the given byte value at the given position.
|
public FixedByteArrayOutputStream(byte[] array,
int offset,
int length)
array - The array to wrap.offset - The offset to start the OutputStream at.length - The maximum length of the OutputStream.java.lang.NullPointerException - If array is null.java.lang.ArrayIndexOutOfBoundsException - If offset and/or length are invalid.public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(int byteValue,
int streamPosition)
throws java.io.IOException
RandomAccessOutputStreamwrite in interface RandomAccessOutputStreambyteValue - The value to write.streamPosition - The position to write at.java.io.IOException - If an IO Exception occurred.public void write(byte[] buffer,
int bufferOffset,
int length,
int streamPosition)
throws java.io.IOException
RandomAccessOutputStreamwrite in interface RandomAccessOutputStreambuffer - The buffer to write from.bufferOffset - The offset within the buffer to start at.length - The number of bytes to write.streamPosition - The position within the OutputStream to write at.java.io.IOException - If an IO Exception occurred.public java.io.OutputStream subStream(int streamPosition,
int length)
RandomAccessOutputStreamsubStream in interface RandomAccessOutputStreamstreamPosition - The position to start at.length - The length of the OutputStream.public int size()
RandomAccessOutputStreamsize in interface RandomAccessOutputStreampublic ByteArraySegment getData()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStream