Class MemorySBOS

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, BitOut

    public class MemorySBOS
    extends BitByteOutputStream
    This class extends the BitByteOutputStream, so it provides the compression writing functions, but uses a MemoryOutputStream as an underlying OutputStream, so it is needed to be flushed to disk separately. It uses BitByteOutputStream and not BitOutputStream because the MemoryOutputStream class has already its own buffer (to keep everything in memory), and extra buffering is inadequate.
    Author:
    Roi Blanco
    • Constructor Detail

      • MemorySBOS

        public MemorySBOS()
                   throws java.io.IOException
        Constructor for the class. Instanciates the BitByteOutputStream and MemoryOutputStream classes.
        Throws:
        java.io.IOException - if an I/O error occurs.
    • Method Detail

      • toString

        public java.lang.String toString()
        Writes the underlying MemoryOutputStream in String format.
        Overrides:
        toString in class java.lang.Object
      • getSize

        public int getSize()
        Return the amount of memory bytes consumed by the underlying buffer