code: private PngChunk processTailChunks(PngImage result, Iterator<PngChunk> itBaseChunks, PngChunk lastBaseChunk) throws IOException {
  		while (lastBaseChunk != null) {
  			if (lastBaseChunk.isCritical()) {
  				final ByteArrayOutputStream bytes = new ByteArrayOutputStream(lastBaseChunk.getLength());
  				final DataOutputStream data = new DataOutputStream(bytes);
  
  				data.write(lastBaseChunk.getData());
  				data.close();
  
  				final PngChunk newChunk = new PngChunk(lastBaseChunk.getType(), bytes.toByteArray());
  				result.addChunk(newChunk);
  			}
  			lastBaseChunk = itBaseChunks.hasNext() ? itBaseChunks.next() : null;
  		}
  		return lastBaseChunk;
  	}
docs: /*