Top Fields Constructors Methods
org.eclipse.swt.internal.image

pack-priv Class PngChunk

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.swt.internal.image.PngIdatChunk, org.eclipse.swt.internal.image.PngIendChunk, org.eclipse.swt.internal.image.PngIhdrChunk, org.eclipse.swt.internal.image.PngPlteChunk, org.eclipse.swt.internal.image.PngTrnsChunk
Imports
java.io.*, org.eclipse.swt.*

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int[]
pack-priv static final int
pack-priv int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv byte[]
pack-priv static final int
pack-priv static final byte[]
pack-priv static final byte[]
pack-priv static final byte[]
pack-priv static final int
pack-priv static final byte[]
pack-priv static final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
PngChunk(byte[] reference)

Construct a PngChunk using the reference bytes given.

pack-priv
PngChunk(int dataLength)

Construct a PngChunk with the specified number of data bytes.

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
checkCRC()

Compute the CRC value for the chunk's data.

pack-priv int
computeCRC()

Answer the CRC value of chunk's data.

pack-priv void
contributeToString(StringBuilder buffer)

Provided so that subclasses can override and add data to the toString() call.

pack-priv int
pack-priv int
getCRC()

Get the CRC value for the chunk's data.

pack-priv byte[]
getData()

Get the chunk's data.

pack-priv int
getInt16(int offset)

Get the 16-bit integer from the reference byte array at the given offset.

pack-priv int
getInt32(int offset)

Get the 32-bit integer from the reference byte array at the given offset.

pack-priv int
getLength()

Get the length of the data component of this chunk.

pack-priv byte[]
getReference()

Get the PngChunk's reference byteArray;

pack-priv int
getSize()

Get the chunk's total size including the length, type, and crc fields.

pack-priv byte[]
getTypeBytes()

Get the chunk type.

pack-priv boolean
pack-priv static PngChunk
readNextFromStream(LEDataInputStream stream)

Read the next PNG chunk from the input stream given.

pack-priv void
setCRC(int value)

Set the CRC value for the chunk's data.

pack-priv void
setData(byte[] data)

Set the chunk's data.

pack-priv void
setInt16(int offset, int value)

Set the 16-bit integer in the reference byte array at the given offset.

pack-priv void
setInt32(int offset, int value)

Set the 32-bit integer in the reference byte array at the given offset.

pack-priv void
setLength(int value)

Set the length of the data component of this chunk.

pack-priv void
setReference(byte[] reference)

Set the PngChunk's reference byteArray;

pack-priv void
setType(byte[] value)

Set the chunk type.

public String

Returns:

a string representation of the event
toString
()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.
pack-priv boolean
typeMatchesArray(byte[] array)

pack-priv void
validate(PngFileReadState readState, PngIhdrChunk headerChunk)

Answer whether the chunk is a valid PNG chunk.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CHUNK_IDATback to summary
pack-priv static final int CHUNK_IDAT
CHUNK_IENDback to summary
pack-priv static final int CHUNK_IEND
CHUNK_IHDRback to summary
pack-priv static final int CHUNK_IHDR
CHUNK_PLTEback to summary
pack-priv static final int CHUNK_PLTE
CHUNK_tRNSback to summary
pack-priv static final int CHUNK_tRNS
CHUNK_UNKNOWNback to summary
pack-priv static final int CHUNK_UNKNOWN
CRC_TABLEback to summary
pack-priv static final int[] CRC_TABLE
DATA_OFFSETback to summary
pack-priv static final int DATA_OFFSET
lengthback to summary
pack-priv int length
LENGTH_FIELD_LENGTHback to summary
pack-priv static final int LENGTH_FIELD_LENGTH
LENGTH_OFFSETback to summary
pack-priv static final int LENGTH_OFFSET
MIN_LENGTHback to summary
pack-priv static final int MIN_LENGTH
referenceback to summary
pack-priv byte[] reference
TYPE_FIELD_LENGTHback to summary
pack-priv static final int TYPE_FIELD_LENGTH
TYPE_IDATback to summary
pack-priv static final byte[] TYPE_IDAT
TYPE_IENDback to summary
pack-priv static final byte[] TYPE_IEND
TYPE_IHDRback to summary
pack-priv static final byte[] TYPE_IHDR
TYPE_OFFSETback to summary
pack-priv static final int TYPE_OFFSET
TYPE_PLTEback to summary
pack-priv static final byte[] TYPE_PLTE
TYPE_tRNSback to summary
pack-priv static final byte[] TYPE_tRNS

Constructor Detail

PngChunkback to summary
pack-priv PngChunk(byte[] reference)

Construct a PngChunk using the reference bytes given.

PngChunkback to summary
pack-priv PngChunk(int dataLength)

Construct a PngChunk with the specified number of data bytes.

Method Detail

checkCRCback to summary
pack-priv boolean checkCRC()

Compute the CRC value for the chunk's data. Answer whether this value matches the value stored in the chunk.

computeCRCback to summary
pack-priv int computeCRC()

Answer the CRC value of chunk's data.

contributeToStringback to summary
pack-priv void contributeToString(StringBuilder buffer)

Provided so that subclasses can override and add data to the toString() call.

getChunkTypeback to summary
pack-priv int getChunkType()
getCRCback to summary
pack-priv int getCRC()

Get the CRC value for the chunk's data. Ensure that the length field has a good value before making this call.

getDataback to summary
pack-priv byte[] getData()

Get the chunk's data.

getInt16back to summary
pack-priv int getInt16(int offset)

Get the 16-bit integer from the reference byte array at the given offset.

getInt32back to summary
pack-priv int getInt32(int offset)

Get the 32-bit integer from the reference byte array at the given offset.

getLengthback to summary
pack-priv int getLength()

Get the length of the data component of this chunk. This is not the length of the entire chunk.

getReferenceback to summary
pack-priv byte[] getReference()

Get the PngChunk's reference byteArray;

getSizeback to summary
pack-priv int getSize()

Get the chunk's total size including the length, type, and crc fields.

getTypeBytesback to summary
pack-priv byte[] getTypeBytes()

Get the chunk type. This is a four byte value. Each byte should be an ASCII character. The first byte is upper case if the chunk is critical. The second byte is upper case if the chunk is publicly defined. The third byte must be upper case. The fourth byte is upper case if the chunk is unsafe to copy. Public chunk types are defined by the PNG Development Group.

isCriticalback to summary
pack-priv boolean isCritical()
readNextFromStreamback to summary
pack-priv static PngChunk readNextFromStream(LEDataInputStream stream)

Read the next PNG chunk from the input stream given. If unable to read a chunk, return null.

setCRCback to summary
pack-priv void setCRC(int value)

Set the CRC value for the chunk's data. Ensure that the length field has a good value before making this call.

setDataback to summary
pack-priv void setData(byte[] data)

Set the chunk's data. This method has two side-effects. 1. It will set the length field to be the length of the data array given. 2. It will set the CRC field to the computed CRC value of the data array given.

setInt16back to summary
pack-priv void setInt16(int offset, int value)

Set the 16-bit integer in the reference byte array at the given offset.

setInt32back to summary
pack-priv void setInt32(int offset, int value)

Set the 32-bit integer in the reference byte array at the given offset.

setLengthback to summary
pack-priv void setLength(int value)

Set the length of the data component of this chunk. This is not the length of the entire chunk.

setReferenceback to summary
pack-priv void setReference(byte[] reference)

Set the PngChunk's reference byteArray;

setTypeback to summary
pack-priv void setType(byte[] value)

Set the chunk type. This is a four byte value. Each byte should be an ASCII character. The first byte is upper case if the chunk is critical. The second byte is upper case if the chunk is publicly defined. The third byte must be upper case. The fourth byte is upper case if the chunk is unsafe to copy. Public chunk types are defined by the PNG Development Group.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string containing a concise, human-readable description of the receiver.

Returns:String

a string representation of the event

Annotations
@Override
typeMatchesArrayback to summary
pack-priv boolean typeMatchesArray(byte[] array)
validateback to summary
pack-priv void validate(PngFileReadState readState, PngIhdrChunk headerChunk)

Answer whether the chunk is a valid PNG chunk.