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:
Closeable
,Flushable
,AutoCloseable
,Finalizable
This class applies a RunLengthEncode filter to the stream.
- Version:
- $Id: RunLengthEncodeOutputStream.java 1804124 2017-08-04 14:13:54Z ssteiner $ Originally authored by Stephen Wolke.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private int
private static final int
private static final int
private static final int
private byte[]
private int
private static final int
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
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) Methods inherited from class java.io.FilterOutputStream
flush, write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
MAX_SEQUENCE_COUNT
private static final int MAX_SEQUENCE_COUNT- See Also:
-
END_OF_DATA
private static final int END_OF_DATA- See Also:
-
BYTE_MAX
private static final int BYTE_MAX- See Also:
-
NOT_IDENTIFY_SEQUENCE
private static final int NOT_IDENTIFY_SEQUENCE- See Also:
-
START_SEQUENCE
private static final int START_SEQUENCE- See Also:
-
IN_SEQUENCE
private static final int IN_SEQUENCE- See Also:
-
NOT_IN_SEQUENCE
private static final int NOT_IN_SEQUENCE- See Also:
-
runCount
private int runCount -
isSequence
private int isSequence -
runBuffer
private byte[] runBuffer
-
-
Constructor Details
-
RunLengthEncodeOutputStream
- See Also:
-
-
Method Details
-
write
- Throws:
IOException
- See Also:
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
- See Also:
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
- See Also:
-
finalizeStream
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:
IOException
- In case of an IO problem- See Also:
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
- See Also:
-