Class BitFile


  • class BitFile
    extends java.lang.Object
    Came from GIFEncoder initially. Modified - to allow for output compressed data without the block counts which breakup the compressed data stream for GIF.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int bitsLeft  
      (package private) boolean blocks
      note this also indicates gif format BITFile.
      (package private) byte[] buffer  
      (package private) int index  
      (package private) java.io.OutputStream output  
    • Constructor Summary

      Constructors 
      Constructor Description
      BitFile​(java.io.OutputStream output, boolean blocks)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()  
      void writeBits​(int bits, int numbits)  
      • Methods inherited from class java.lang.Object

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

      • output

        java.io.OutputStream output
      • buffer

        byte[] buffer
      • index

        int index
      • bitsLeft

        int bitsLeft
      • blocks

        boolean blocks
        note this also indicates gif format BITFile.
    • Constructor Detail

      • BitFile

        public BitFile​(java.io.OutputStream output,
                       boolean blocks)
        Parameters:
        output - destination for output data
        blocks - GIF LZW requires block counts for output data
    • Method Detail

      • flush

        public void flush()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • writeBits

        public void writeBits​(int bits,
                              int numbits)
                       throws java.io.IOException
        Throws:
        java.io.IOException