Class AbstractRLEDecoder
- java.lang.Object
-
- com.twelvemonkeys.imageio.plugins.bmp.AbstractRLEDecoder
-
- All Implemented Interfaces:
Decoder
- Direct Known Subclasses:
RLE4Decoder,RLE8Decoder
abstract class AbstractRLEDecoder extends java.lang.Object implements Decoder
Abstract base class for RLE decoding as specified by in the Windows BMP (aka DIB) file format.- Version:
- $Id: AbstractRLEDecoder.java#1 $
-
-
Constructor Summary
Constructors Constructor Description AbstractRLEDecoder(int width, int bitsPerSample)Creates an RLEDecoder.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static intcheckEOF(int val)Checks a read byte for EOF marker.intdecode(java.io.InputStream stream, java.nio.ByteBuffer buffer)Decodes as much data as possible, from the stream into the buffer.protected abstract voiddecodeRow(java.io.InputStream stream)Decodes one full row of image data.
-
-
-
Method Detail
-
decodeRow
protected abstract void decodeRow(java.io.InputStream stream) throws java.io.IOExceptionDecodes one full row of image data.- Parameters:
stream- the input stream containing RLE data- Throws:
java.io.IOException- if an I/O related exception occurs while reading
-
decode
public final int decode(java.io.InputStream stream, java.nio.ByteBuffer buffer) throws java.io.IOExceptionDecodes as much data as possible, from the stream into the buffer.
-
checkEOF
protected static int checkEOF(int val) throws java.io.EOFExceptionChecks a read byte for EOF marker.- Parameters:
val- the byte to check- Returns:
- the value of
valif positive. - Throws:
java.io.EOFException- ifvalis negative
-
-