FileDocCategorySizeDatePackage
PNGChunk.javaAPI DocExample677Mon Apr 05 11:21:24 BST 1999None

PNGChunk

public class PNGChunk extends Object

Fields Summary
private byte[]
mType
private byte[]
mData
Constructors Summary
public PNGChunk(byte[] type, byte[] data)

    mType = type;
    mData = data;
  
Methods Summary
public byte[]getData()

 return mData; 
public java.lang.StringgetTypeString()

    try { return new String(mType, "UTF8"); }
    catch (UnsupportedEncodingException uee) { return ""; }
  
public shortgetUnsignedByte(int offset)

    return (short)(mData[offset] & 0x00ff);
  
public longgetUnsignedInt(int offset)

    long value = 0;
    for (int i = 0; i < 4; i++)
      value += (mData[offset + i] & 0xff) << ((3 - i) * 8);
    return value;