public class ChunkRaw extends Object
Short lived object, to be created while serialing/deserializing Do not reuse it for different chunks.
See http://www.libpng.org/pub/png/spec/1.2/PNG-Structure.html
Modifier and Type | Field and Description |
---|---|
byte[] |
crcval
A 4-byte CRC (Cyclic Redundancy Check) calculated on the preceding bytes in the chunk, including the chunk type
code and chunk data fields, but not including the length field.
|
byte[] |
data
The data bytes appropriate to the chunk type, if any.
|
String |
id |
byte[] |
idbytes
A 4-byte chunk type code.
|
int |
len
The length counts only the data field, not itself, the chunk type code, or the CRC.
|
Constructor and Description |
---|
ChunkRaw(int len,
byte[] idbytes,
boolean alloc) |
ChunkRaw(int len,
String id,
boolean alloc) |
Modifier and Type | Method and Description |
---|---|
void |
allocData() |
void |
checkCrc() |
boolean |
equals(Object obj) |
long |
getOffset()
offset in the full PNG stream, in bytes.
|
int |
hashCode() |
void |
setOffset(long offset) |
String |
toString() |
void |
updateCrc(byte[] buf,
int off,
int len) |
void |
writeChunk(OutputStream os)
Computes the CRC and writes to the stream.
|
void |
writeChunkCrc(OutputStream os) |
void |
writeChunkHeader(OutputStream os) |
public final int len
public final byte[] idbytes
public final String id
public byte[] data
public byte[] crcval
public ChunkRaw(int len, String id, boolean alloc)
public ChunkRaw(int len, byte[] idbytes, boolean alloc)
public void allocData()
public void writeChunk(OutputStream os)
public void writeChunkHeader(OutputStream os)
public void writeChunkCrc(OutputStream os)
public void checkCrc()
public void updateCrc(byte[] buf, int off, int len)
public long getOffset()
public void setOffset(long offset)
Copyright © 2014. All rights reserved.