Package org.apache.xmlgraphics.util.io
Class RunLengthEncodeOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.apache.xmlgraphics.util.io.RunLengthEncodeOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,Finalizable
public class RunLengthEncodeOutputStream extends java.io.FilterOutputStream implements Finalizable
This class applies a RunLengthEncode filter to the stream.- Version:
- $Id$ Originally authored by Stephen Wolke.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BYTE_MAX
private static int
END_OF_DATA
private static int
IN_SEQUENCE
private int
isSequence
private static int
MAX_SEQUENCE_COUNT
private static int
NOT_IDENTIFY_SEQUENCE
private static int
NOT_IN_SEQUENCE
private byte[]
runBuffer
private int
runCount
private static int
START_SEQUENCE
-
Constructor Summary
Constructors Constructor Description RunLengthEncodeOutputStream(java.io.OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
finalizeStream()
This method can be called instead of close() on a subclass of FilteredOutputStream when a final marker has to be written to the target stream, but close() cannot be called.void
write(byte b)
void
write(byte[] b)
void
write(byte[] b, int off, int len)
-
-
-
Field Detail
-
MAX_SEQUENCE_COUNT
private static final int MAX_SEQUENCE_COUNT
- See Also:
- Constant Field Values
-
END_OF_DATA
private static final int END_OF_DATA
- See Also:
- Constant Field Values
-
BYTE_MAX
private static final int BYTE_MAX
- See Also:
- Constant Field Values
-
NOT_IDENTIFY_SEQUENCE
private static final int NOT_IDENTIFY_SEQUENCE
- See Also:
- Constant Field Values
-
START_SEQUENCE
private static final int START_SEQUENCE
- See Also:
- Constant Field Values
-
IN_SEQUENCE
private static final int IN_SEQUENCE
- See Also:
- Constant Field Values
-
NOT_IN_SEQUENCE
private static final int NOT_IN_SEQUENCE
- See Also:
- Constant Field Values
-
runCount
private int runCount
-
isSequence
private int isSequence
-
runBuffer
private byte[] runBuffer
-
-
Method Detail
-
write
public void write(byte b) throws java.io.IOException
- Throws:
java.io.IOException
- See Also:
FilterOutputStream
-
write
public void write(byte[] b) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
- See Also:
FilterOutputStream
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
- See Also:
FilterOutputStream
-
finalizeStream
public void finalizeStream() throws java.io.IOException
Description copied from interface:Finalizable
This method can be called instead of close() on a subclass of FilteredOutputStream when a final marker has to be written to the target stream, but close() cannot be called.- Specified by:
finalizeStream
in interfaceFinalizable
- Throws:
java.io.IOException
- In case of an IO problem- See Also:
Finalizable
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.FilterOutputStream
- Throws:
java.io.IOException
- See Also:
FilterOutputStream
-
-