|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
korat.utils.io.BitOutputStream
public class BitOutputStream
Utility for writing bits to underlying OutputStream
Field Summary | |
---|---|
private int |
buff
|
private int |
buffSize
|
private static long[] |
MASKS
|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
BitOutputStream(OutputStream out)
|
Method Summary | |
---|---|
void |
flush()
Flush internal buffers to underlying layer |
void |
writeBits(long b,
int len)
Writes len bits of the given value
b |
void |
writeBits(long b,
int off,
int len)
Writes len bits of the given value
b |
void |
writeDouble(double x)
Write given double in 64 bits |
void |
writeFloat(float x)
Write given float in 32 bits |
void |
writeInt(int x)
Write given int in 32 bits |
void |
writeLong(long x)
Write given long in 64 bits |
Methods inherited from class java.io.FilterOutputStream |
---|
close, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long[] MASKS
private int buff
private int buffSize
Constructor Detail |
---|
public BitOutputStream(OutputStream out)
out
- as per the general contract of the
FilterOutputStream
Method Detail |
---|
public void writeBits(long b, int len) throws IOException
IBitWriter
len
bits of the given value
b starting from bit offset 0.
- Specified by:
writeBits
in interface IBitWriter
- Parameters:
b
- bits to writelen
- number of bits from value b
to write
- Throws:
IOException
- if an I/O error occurs.
public void writeBits(long b, int off, int len) throws IOException
IBitWriter
len
bits of the given value
b starting from bit offset off
.
- Specified by:
writeBits
in interface IBitWriter
- Parameters:
b
- bits to writeoff
- number of bits from the given value b
to skiplen
- number of bits from the given value b
to write
starting from off
-th bit
- Throws:
IOException
- if an I/O error occurs.
public void writeInt(int x) throws IOException
IBitWriter
writeInt
in interface IBitWriter
x
- int value to write
IOException
- if an I/O error occurs.public void writeLong(long x) throws IOException
IBitWriter
writeLong
in interface IBitWriter
x
- long value to write
IOException
- if an I/O error occurs.public void writeFloat(float x) throws IOException
IBitWriter
writeFloat
in interface IBitWriter
x
- float value to write
IOException
- if an I/O error occurs.public void writeDouble(double x) throws IOException
IBitWriter
writeDouble
in interface IBitWriter
x
- double value to write
IOException
- if an I/O error occurs.public void flush() throws IOException
IBitWriter
flush
in interface Flushable
flush
in interface IBitWriter
flush
in class FilterOutputStream
IOException
- if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |