code: private byte[] getChunkData(InputStream ins, int length) throws PngException {
  		byte[] data = new byte[length];
  		try {
  			int actual = ins.read(data);
  			if (actual < length) {
  				throw new PngException(String.format("Expected %d bytes but got %d", length, actual));
  			}
  		} catch (IOException e) {
  			throw new PngException("Error reading chunk data", e);
  		}
  
  		return data;
  	}
docs: /*