Documentation of 'org.freehep.util.io.CompressableOutputStream' Java class
CompressableOutputStream
org.freehep.util.io

Class CompressableOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, FinishableOutputStream
    Direct Known Subclasses:
    BitOutputStream


    public class CompressableOutputStream
    extends java.io.FilterOutputStream
    implements FinishableOutputStream
    Special stream that can be used to write a header in uncompressed format, and the rest of the stream in compressed format. This stream is used by SWF, to compress the tail of the stream.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CompressableOutputStream(java.io.OutputStream out)
      Creates a Compressable Output Stream from given stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close() 
      void finish()
      Finishes the current outputstream (compresses, flushes, caluclates CRC) and writes whatever is left in the buffers, but does not close the stream.
      void startCompressing()
      Start compressing from the next byte onwards.
      void write(byte[] b, int off, int len) 
      void write(int b) 
      • Methods inherited from class java.io.FilterOutputStream

        flush, write
      • Methods inherited from class java.lang.Object

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

      • CompressableOutputStream

        public CompressableOutputStream(java.io.OutputStream out)
        Creates a Compressable Output Stream from given stream. Initially the stream does not compress.
        Parameters:
        out - stream to write to
    • Method Detail

      • write

        public void write(int b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • write

        public void write(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • finish

        public void finish()
                    throws java.io.IOException
        Description copied from interface: FinishableOutputStream
        Finishes the current outputstream (compresses, flushes, caluclates CRC) and writes whatever is left in the buffers, but does not close the stream.
        Specified by:
        finish in interface FinishableOutputStream
        Throws:
        java.io.IOException - if write fails
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • startCompressing

        public void startCompressing()
                              throws java.io.IOException
        Start compressing from the next byte onwards. Flushes what is currently in the buffer to the underlying stream and start compression from here.
        Throws:
        java.io.IOException - if write fails

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.