public class ByteCountOutputStream extends ByteOrderOutputStream
little, writtenout| Constructor and Description |
|---|
ByteCountOutputStream(OutputStream out,
boolean littleEndian)
Create a Byte Count output stream from given stream
|
| Modifier and Type | Method and Description |
|---|---|
void |
append()
Inserts the bytes written as header and puts the write pointer at the end
of the stream.
|
void |
close()
closes the stream, inserting any non-written header.
|
int |
getBufferLength() |
int |
getLength() |
int |
popBuffer()
returns the number of bytes written since the last pushBuffer call.
|
byte[] |
popBufferBytes()
Similar to pop buffer, but returns the actual byte[] buffer and then
removes it from the bufferList so that subsequent appends will have no
action.
|
void |
pushBuffer()
Pushes the buffer and strat writing to a new one.
|
protected void |
writeByteArray(byte[] bytes,
int offset,
int length) |
protected void |
writeSingleByte(int b) |
size, writeAsciiZString, writeBoolean, writeByte, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeInt, writeLong, writeShort, writeShort, writeString, writeUnsignedByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt, writeUnsignedShort, writeUnsignedShort, writeUTF, writeUTFbyteAlign, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBitsstartCompressing, write, writeflush, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writepublic ByteCountOutputStream(OutputStream out, boolean littleEndian)
out - stream to write tolittleEndian - true if stream should be little endianprotected final void writeSingleByte(int b)
throws IOException
writeSingleByte in class ByteOrderOutputStreamIOExceptionprotected void writeByteArray(byte[] bytes,
int offset,
int length)
throws IOException
writeByteArray in class ByteOrderOutputStreamIOExceptionpublic void pushBuffer()
throws IOException
IOException - if the write failspublic int popBuffer()
throws IOException
IOException - if the write failspublic byte[] popBufferBytes()
throws IOException
IOException - if write failspublic int getBufferLength()
public int getLength()
public void append()
throws IOException
IOException - if write failspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class BitOutputStreamIOExceptionCopyright © 2016. All rights reserved.