|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
fr.up7.info.RLEOutputStream
public class RLEOutputStream
A RLEOutputStream
implements a stream filter to compress data
and physically write it using a RLE format.
The format is such that any too long running subsequence of the same single
letter in the original data is encoded as the length of the run and the
letter. As aaaabbdeaaa
could simply be encoded as
*4abbde*3a
.
FilterOutputStream
Field Summary |
---|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
RLEOutputStream(OutputStream os)
Constructs a compressing output stream from a given output stream. |
Method Summary | |
---|---|
void |
close()
Closes the stream. |
void |
flush()
Flushes this output stream, forces any buffered data to be written |
int |
offset()
Gets the length of the compressed data stream. |
void |
write(int b)
Writes a byte of uncompressed data. |
Methods inherited from class java.io.FilterOutputStream |
---|
write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RLEOutputStream(OutputStream os) throws fr.up7.info.RLEHeaderException
os
- the underlying output stream.
RLEMissingHeaderException
- if no header is found in the file
RLEUnknownHeaderException
- if an unknown header is found.
fr.up7.info.RLEHeaderException
Method Detail |
---|
public void write(int b) throws IOException
write
in class FilterOutputStream
IOException
- if an I/O error has occured.FilterOutputStream.out
public void close() throws IOException
close
in interface Closeable
close
in class FilterOutputStream
IOException
- if an I/O error has occured.FilterOutputStream.out
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
- if an I/O error has occuredpublic int offset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |