public class DefaultBitOutputStream extends java.io.OutputStream implements BitOutputStream
Constructor and Description |
---|
DefaultBitOutputStream(java.io.OutputStream delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
java.lang.String |
toString() |
void |
write(boolean bit)
Write a single bit specified in the boolean argument.
|
void |
write(boolean bit,
long repeat)
Write a single bit specified in the boolean argument repeatedly.
|
void |
write(byte b) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int length) |
void |
write(byte bitContainer,
int nofBits)
Write specified number of bits supplied in the byte value.
|
void |
write(int value) |
void |
write(int bitContainer,
int nofBits)
Write specified number of bits supplied in the integer value.
|
void |
write(long bitContainer,
int nofBits)
Write specified number of bits supplied in the long value.
|
public DefaultBitOutputStream(java.io.OutputStream delegate)
public void write(byte b)
public void write(int value)
write
in class java.io.OutputStream
public java.lang.String toString()
toString
in class java.lang.Object
public void write(long bitContainer, int nofBits)
BitOutputStream
write
in interface BitOutputStream
bitContainer
- an integer containing the bits to be written outnofBits
- the number of bits to written out, minimum 0, maximum 64.public void write(int bitContainer, int nofBits)
BitOutputStream
write
in interface BitOutputStream
bitContainer
- an integer containing the bits to be written outnofBits
- the number of bits to written out, minimum 0, maximum 32.public void write(byte bitContainer, int nofBits)
BitOutputStream
write
in interface BitOutputStream
bitContainer
- an integer containing the bits to be written outnofBits
- the number of bits to written out, minimum 0, maximum 8.public void write(boolean bit)
BitOutputStream
write
in interface BitOutputStream
bit
- emit 1 if true, 0 otherwise.public void write(boolean bit, long repeat)
BitOutputStream
write
in interface BitOutputStream
bit
- emit 1 if true, 0 otherwise.repeat
- the number of bits to emit.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
public void write(byte[] b)
write
in class java.io.OutputStream
public void write(byte[] b, int off, int length)
write
in class java.io.OutputStream