code: private PngByteArrayOutputStream serialize(List<byte[]> scanlines) {
  		final int scanlineLength = scanlines.get(0).length;
  		final byte[] imageData = new byte[scanlineLength * scanlines.size()];
  		for (int i = 0; i < scanlines.size(); i++) {
  			final int offset = i * scanlineLength;
  			final byte[] scanline = scanlines.get(i);
  			System.arraycopy(scanline, 0, imageData, offset, scanlineLength);
  		}
  
  		return new PngByteArrayOutputStream(imageData);
  	}
docs: /*