|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream org.freehep.util.io.CompressableOutputStream org.freehep.util.io.BitOutputStream
Class to write bits to a Stream, allowing for byte synchronization. Signed, Unsigned, Booleans and Floats can be written.
Field Summary |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
BitOutputStream(OutputStream out)
|
Method Summary | |
void |
byteAlign()
A utility to force the next write to be byte-aligned. |
void |
close()
|
void |
finish()
|
protected void |
flushByte()
A utility method to flush the next byte |
static int |
minBits(float number)
calculates the minumum number of bits necessary to write number. |
static int |
minBits(long number)
|
static int |
minBits(long number,
boolean signed)
|
void |
write(int b)
|
void |
writeBitFlag(boolean bit)
Write a bit to the output stream. |
void |
writeFBits(float value,
int n)
Write a float value of n-bits to the stream. |
void |
writeSBits(long value,
int n)
Write a signed value of n-bits to the output stream. |
void |
writeUBits(long value,
int n)
Write an unsigned value of n-bits to the output stream. |
Methods inherited from class org.freehep.util.io.CompressableOutputStream |
startCompressing, write |
Methods inherited from class java.io.FilterOutputStream |
flush, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BitOutputStream(OutputStream out)
Method Detail |
public void write(int b) throws IOException
write
in class CompressableOutputStream
IOException
public void finish() throws IOException
finish
in interface FinishableOutputStream
finish
in class CompressableOutputStream
IOException
public void close() throws IOException
close
in class CompressableOutputStream
IOException
protected void flushByte() throws IOException
IOException
public void byteAlign() throws IOException
IOException
public void writeBitFlag(boolean bit) throws IOException
IOException
public void writeSBits(long value, int n) throws IOException
IOException
public void writeFBits(float value, int n) throws IOException
IOException
public void writeUBits(long value, int n) throws IOException
IOException
public static int minBits(float number)
number
- number
public static int minBits(long number)
public static int minBits(long number, boolean signed)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |