org.gcube.indexmanagement.common
Class CompressingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.gcube.indexmanagement.common.CompressingOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class CompressingOutputStream
extends FilterOutputStream

An OutputStream used to output LZW compressed data. See http://en.wikipedia.org/wiki/LZW for an explanation of the algorithm.

Version:
0.1
See Also:
DecompressingInputStream

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
CompressingOutputStream(OutputStream out)
          Constructor which wraps an output stream, and initializes the code map with all possible values of a single byte, before increasing the codesize to the size of one byte + 1 to make place for the next code
 
Method Summary
 void close()
          
 void write(byte[] bytes)
          
 void write(byte[] bytes, int off, int len)
          
 void write(int b)
          
 
Methods inherited from class java.io.FilterOutputStream
flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressingOutputStream

public CompressingOutputStream(OutputStream out)
Constructor which wraps an output stream, and initializes the code map with all possible values of a single byte, before increasing the codesize to the size of one byte + 1 to make place for the next code

Parameters:
out - - the output stream to output the results trough
Method Detail

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] bytes)
           throws IOException

Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] bytes,
                  int off,
                  int len)
           throws IOException

Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(int b)
           throws IOException

Overrides:
write in class FilterOutputStream
Throws:
IOException


Copyright © 2013. All Rights Reserved.