Esempio n. 1
0
 /** Construct a PngChunk with the specified number of data bytes. */
 PngChunk(int dataLength) {
   this(new byte[MIN_LENGTH + dataLength]);
   setLength(dataLength);
 }
Esempio n. 2
0
 /**
  * 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.
  */
 void setData(byte[] data) {
   setLength(data.length);
   System.arraycopy(data, 0, reference, DATA_OFFSET, data.length);
   setCRC(computeCRC());
 }