org.gcube.indexmanagement.common
Class CompressingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
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
|
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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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 © 2012. All Rights Reserved.