Class BitArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.commons.imaging.formats.tiff.itu_t4.BitArrayOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
final class BitArrayOutputStream extends java.io.OutputStreamOutput stream writing to a byte array, and capable of writing 1 bit at a time, starting from the most significant bit.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufferprivate intbytesWrittenprivate intcacheprivate intcacheMask
-
Constructor Summary
Constructors Constructor Description BitArrayOutputStream()BitArrayOutputStream(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()intgetBitsAvailableInCurrentByte()intsize()byte[]toByteArray()voidwrite(int b)voidwriteBit(int bit)private voidwriteByte(int b)
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream
-
flush
public void flush()
- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream
-
getBitsAvailableInCurrentByte
public int getBitsAvailableInCurrentByte()
-
size
public int size()
-
toByteArray
public byte[] toByteArray()
-
write
public void write(int b)
- Specified by:
writein classjava.io.OutputStream
-
writeBit
public void writeBit(int bit)
-
writeByte
private void writeByte(int b)
-
-