Class RunLengthEncodeOutputStream

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

    public class RunLengthEncodeOutputStream
    extends java.io.FilterOutputStream
    implements Finalizable
    This class applies a RunLengthEncode filter to the stream.
    Version:
    $Id: RunLengthEncodeOutputStream.java 1804124 2017-08-04 14:13:54Z ssteiner $ Originally authored by Stephen Wolke.
    • Field Summary

      • Fields inherited from class java.io.FilterOutputStream

        out
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void finalizeStream()
      This method can be called instead of close() on a subclass of FilteredOutputStream when a final marker has to be written to the target stream, but close() cannot be called.
      void write​(byte b)  
      void write​(byte[] b)  
      void write​(byte[] b, int off, int len)  
      • Methods inherited from class java.io.FilterOutputStream

        flush, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

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

      • RunLengthEncodeOutputStream

        public RunLengthEncodeOutputStream​(java.io.OutputStream out)
        See Also:
        FilterOutputStream
    • Method Detail

      • write

        public void write​(byte b)
                   throws java.io.IOException
        Throws:
        java.io.IOException
        See Also:
        FilterOutputStream
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
        See Also:
        FilterOutputStream
      • 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
        See Also:
        FilterOutputStream
      • finalizeStream

        public void finalizeStream()
                            throws java.io.IOException
        Description copied from interface: Finalizable
        This method can be called instead of close() on a subclass of FilteredOutputStream when a final marker has to be written to the target stream, but close() cannot be called.
        Specified by:
        finalizeStream in interface Finalizable
        Throws:
        java.io.IOException - In case of an IO problem
        See Also:
        Finalizable
      • close

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