code: private PngChunk processHeadChunks(PngImage result, Iterator<PngChunk> itChunks) throws IOException {
  		PngChunk chunk = null;
  		while (itChunks.hasNext()) {
  			chunk = itChunks.next();
  			if (PngChunk.IMAGE_DATA.equals(chunk.getTypeString())) {
  				break;
  			}
  
  			if (chunk.isRequired()) {
  				final ByteArrayOutputStream bytes = new ByteArrayOutputStream(chunk.getLength());
  				final DataOutputStream data = new DataOutputStream(bytes);
  
  				data.write(chunk.getData());
  				data.close();
  
  				final PngChunk newChunk = new PngChunk(chunk.getType(), bytes.toByteArray());
  				if (PngChunk.IMAGE_HEADER.equals(chunk.getTypeString())) {
  					newChunk.setInterlace((byte) 0);
  				}
  				result.addChunk(newChunk);
  			}
  		}
  		return chunk;
  	}
docs: /*