public class ByteCountOutputStream extends ByteOrderOutputStream
little, written
out
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, writeUTF
byteAlign, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBits
startCompressing, write, write
flush, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write, write, write
public 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 ByteOrderOutputStream
IOException
protected void writeByteArray(byte[] bytes, int offset, int length) throws IOException
writeByteArray
in class ByteOrderOutputStream
IOException
public 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 Closeable
close
in interface AutoCloseable
close
in class BitOutputStream
IOException
Copyright © 2016. All rights reserved.