BitOutputStream
, Closeable
, Flushable
, AutoCloseable
public class DefaultBitOutputStream extends OutputStream implements BitOutputStream
Constructor | Description |
---|---|
DefaultBitOutputStream(OutputStream delegate) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
flush() |
|
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(OutputStream delegate)
public void write(byte b) throws IOException
IOException
public void write(int value) throws IOException
write
in class OutputStream
IOException
public void write(long bitContainer, int nofBits) throws IOException
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.IOException
- as per streaming contract in java.public void write(int bitContainer, int nofBits) throws IOException
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.IOException
- as per streaming contract in java.public void write(byte bitContainer, int nofBits) throws IOException
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.IOException
- as per streaming contract in java.public void write(boolean bit) throws IOException
BitOutputStream
write
in interface BitOutputStream
bit
- emit 1 if true, 0 otherwise.IOException
- as per streaming contract in java.public void write(boolean bit, long repeat) throws IOException
BitOutputStream
write
in interface BitOutputStream
bit
- emit 1 if true, 0 otherwise.repeat
- the number of bits to emit.IOException
- as per streaming contract in java.public void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int length) throws IOException
write
in class OutputStream
IOException