Class BitStream.Out

  • Enclosing class:
    BitStream

    public static class BitStream.Out
    extends java.lang.Object
    A bit output stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      Out​(java.io.OutputStream out)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Flush and close the stream.
      void flush()
      Flush the stream.
      static int getGolombSize​(int divisor, int value)
      Get the size of the Golomb code for this value.
      void writeBit​(int bit)
      Write a bit.
      void writeGolomb​(int divisor, int value)
      Write the Golomb code of a value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Out

        public Out​(java.io.OutputStream out)
    • Method Detail

      • writeGolomb

        public void writeGolomb​(int divisor,
                                int value)
        Write the Golomb code of a value.
        Parameters:
        divisor - the divisor
        value - the value
      • getGolombSize

        public static int getGolombSize​(int divisor,
                                        int value)
        Get the size of the Golomb code for this value.
        Parameters:
        divisor - the divisor
        value - 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.