org.freehep.util.io
Class RunLengthOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.freehep.util.io.RunLengthOutputStream
All Implemented Interfaces:
Closeable, Flushable, FinishableOutputStream, RunLength

public class RunLengthOutputStream
extends FilterOutputStream
implements RunLength, FinishableOutputStream

The RunLengthOutputStream encodes data as Run Length encoding. The exact definition of Run Length encoding can be found in the PostScript Language Reference (3rd ed.) chapter 3.13.3.

Version:
$Id: RunLengthOutputStream.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Fields inherited from interface org.freehep.util.io.RunLength
EOD, LENGTH
 
Constructor Summary
RunLengthOutputStream(OutputStream out)
          Create a Run Length output stream
 
Method Summary
 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 write(int a)
           
 
Methods inherited from class java.io.FilterOutputStream
flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunLengthOutputStream

public RunLengthOutputStream(OutputStream out)
Create a Run Length output stream

Parameters:
out - stream to write
Method Detail

write

public void write(int a)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

finish

public void finish()
            throws 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:
IOException - if write fails

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterOutputStream
Throws:
IOException


Copyright © 2000-2007 FreeHEP. All Rights Reserved.