Package org.h2.dev.util
Class BinaryArithmeticStream.Out
- java.lang.Object
-
- org.h2.dev.util.BinaryArithmeticStream
-
- org.h2.dev.util.BinaryArithmeticStream.Out
-
- Enclosing class:
- BinaryArithmeticStream
public static class BinaryArithmeticStream.Out extends BinaryArithmeticStream
A binary arithmetic output stream.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.h2.dev.util.BinaryArithmeticStream
BinaryArithmeticStream.Huffman, BinaryArithmeticStream.In, BinaryArithmeticStream.Out
-
-
Field Summary
-
Fields inherited from class org.h2.dev.util.BinaryArithmeticStream
high, low, MAX_PROBABILITY
-
-
Constructor Summary
Constructors Constructor Description Out(java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()Flush the stream.voidwriteBit(boolean value, int probability)Write a bit.voidwriteGolomb(int divisor, int value)Write the Golomb code of a value.
-
-
-
Method Detail
-
writeBit
public void writeBit(boolean value, int probability) throws java.io.IOExceptionWrite a bit.- Parameters:
value- the valueprobability- the probability that the value is true- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionFlush the stream.- Throws:
java.io.IOException
-
writeGolomb
public void writeGolomb(int divisor, int value) throws java.io.IOExceptionWrite the Golomb code of a value.- Parameters:
divisor- the divisorvalue- the value- Throws:
java.io.IOException
-
-