picture.io
Class RLEOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
              |
              +--picture.io.RLEOutputStream

public class RLEOutputStream
extends java.io.FilterOutputStream

Output stream which transforms its data via Run-Length-Encoding.


Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
RLEOutputStream(java.io.OutputStream out)
          Initialize and set output stream.
 
Method Summary
 void close()
          Closes the underlying output stream.
 void flush()
          Transforms the cached data and writes it to the underlying output stream, which is flushed, too.
static void main(java.lang.String[] args)
           
 void write(byte[] b, int off, int len)
          Encode and write byte array.
 void write(int b)
          Encode and write byte.
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RLEOutputStream

public RLEOutputStream(java.io.OutputStream out)
Initialize and set output stream.
Method Detail

write

public void write(int b)
           throws java.io.IOException
Encode and write byte.
Overrides:
write in class java.io.FilterOutputStream
Parameters:
b - byte to write
Throws:
java.io.IOException -  

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Encode and write byte array. The data is written byte for byte with write(int) to the underlying output stream.
Overrides:
write in class java.io.FilterOutputStream
Parameters:
b - byte array to write
off - starting offset
len - number of bytes to write
Throws:
java.io.IOException -  

flush

public void flush()
           throws java.io.IOException
Transforms the cached data and writes it to the underlying output stream, which is flushed, too.
Overrides:
flush in class java.io.FilterOutputStream
Throws:
IOException. -  

close

public void close()
           throws java.io.IOException
Closes the underlying output stream.
Overrides:
close in class java.io.FilterOutputStream
Throws:
IOException. -  

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException