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)
throws java.io.IOException
java.io.IOExceptionpublic void write(int value)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void write(long bitContainer,
int nofBits)
throws java.io.IOException
BitOutputStreamwrite in interface BitOutputStreambitContainer - an integer containing the bits to be written outnofBits - the number of bits to written out, minimum 0, maximum 64.java.io.IOException - as per streaming contract in java.public void write(int bitContainer,
int nofBits)
throws java.io.IOException
BitOutputStreamwrite in interface BitOutputStreambitContainer - an integer containing the bits to be written outnofBits - the number of bits to written out, minimum 0, maximum 32.java.io.IOException - as per streaming contract in java.public void write(byte bitContainer,
int nofBits)
throws java.io.IOException
BitOutputStreamwrite in interface BitOutputStreambitContainer - an integer containing the bits to be written outnofBits - the number of bits to written out, minimum 0, maximum 8.java.io.IOException - as per streaming contract in java.public void write(boolean bit)
throws java.io.IOException
BitOutputStreamwrite in interface BitOutputStreambit - emit 1 if true, 0 otherwise.java.io.IOException - as per streaming contract in java.public void write(boolean bit,
long repeat)
throws java.io.IOException
BitOutputStreamwrite in interface BitOutputStreambit - emit 1 if true, 0 otherwise.repeat - the number of bits to emit.java.io.IOException - as per streaming contract in java.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int length)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException