public class PNGIDATChunkInputStream
extends java.io.InputStream
Once all IDAT chunks have been read, the read()
methods will
return -1
and isFoundAllIDATChunks()
true
. Once isFoundAllIDATChunks()
returns
true
, the length and type of the first chunk after the last
IDAT chunk may be found by calling getNextChunkLength()
and
getNextChunkType()
, respectively. The source stream will at
this point be positioned at the first byte of the data field after the last
IDAT chunk (which could be the first byte of the CRC code if the length is
zero).
Modifier and Type | Field and Description |
---|---|
private boolean |
foundAllIDATChunks |
(package private) static int |
IDAT_TYPE |
private int |
nextChunkLength |
private int |
nextChunkType |
private int |
numBytesAvailable |
private java.io.DataInputStream |
source |
Constructor and Description |
---|
PNGIDATChunkInputStream(java.io.DataInputStream input,
int firstIDATChunkLength)
Create the stream.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getNextChunkLength() |
(package private) int |
getNextChunkType() |
(package private) boolean |
isFoundAllIDATChunks() |
private void |
nextChunk() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
static final int IDAT_TYPE
private java.io.DataInputStream source
private int numBytesAvailable
private boolean foundAllIDATChunks
private int nextChunkLength
private int nextChunkType
PNGIDATChunkInputStream(java.io.DataInputStream input, int firstIDATChunkLength) throws java.io.IOException
input
- stream positioned at the beginning of the data field of the
first IDAT chunk in the PNG stream.firstIDATChunkLength
- the length of the data field of the first
IDAT chunk.java.io.IOException
private void nextChunk() throws java.io.IOException
java.io.IOException
boolean isFoundAllIDATChunks()
int getNextChunkLength()
int getNextChunkType()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException