Class BitArrayOutputStream
java.lang.Object
java.io.OutputStream
org.apache.commons.imaging.common.itu_t4.BitArrayOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Output stream writing to a byte array, and capable
of writing 1 bit at a time, starting from the most significant bit.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private int
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Field Details
-
buffer
private byte[] buffer -
bytesWritten
private int bytesWritten -
cache
private int cache -
cacheMask
private int cacheMask
-
-
Constructor Details
-
BitArrayOutputStream
BitArrayOutputStream() -
BitArrayOutputStream
BitArrayOutputStream(int size)
-
-
Method Details
-
size
public int size() -
toByteArray
public byte[] toByteArray() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
-
flush
public void flush()- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
-
write
public void write(int b) - Specified by:
write
in classOutputStream
-
writeBit
public void writeBit(int bit) -
getBitsAvailableInCurrentByte
public int getBitsAvailableInCurrentByte() -
writeByte
private void writeByte(int b)
-