Package org.h2.dev.util
Class BitStream.Out
java.lang.Object
org.h2.dev.util.BitStream.Out
- Enclosing class:
BitStream
A bit output stream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flush and close the stream.voidflush()Flush the stream.static intgetGolombSize(int divisor, int value) Get the size of the Golomb code for this value.voidwriteBit(int bit) Write a bit.voidwriteGolomb(int divisor, int value) Write the Golomb code of a value.
-
Constructor Details
-
Out
-
-
Method Details
-
writeGolomb
public void writeGolomb(int divisor, int value) Write the Golomb code of a value.- Parameters:
divisor- the divisorvalue- the value
-
getGolombSize
public static int getGolombSize(int divisor, int value) Get the size of the Golomb code for this value.- Parameters:
divisor- the divisorvalue- the value- Returns:
- the number of bits
-
writeBit
public void writeBit(int bit) Write a bit.- Parameters:
bit- the bit (0 or 1)
-
flush
public void flush()Flush the stream. This will at write at most 7 '0' bits. This will also flush the underlying stream. -
close
public void close()Flush and close the stream. This will also close the underlying stream.
-