code: private static void validateOffset(int offset, int chunkSizeSoFar) {
          if (offset == 0) {
              throw new DecompressionException("Offset is less than minimum permissible value");
          }
  
          if (offset < 0) {
              // Due to arithmetic overflow
              throw new DecompressionException("Offset is greater than maximum value supported by this implementation");
          }
  
          if (offset > chunkSizeSoFar) {
              throw new DecompressionException("Offset exceeds size of chunk");
          }
      }
docs: Validates that the offset extracted from a compressed reference is within
  the permissible bounds of an offset (0 < offset < Integer.MAX_VALUE), and does not
  exceed the length of the chunk currently read so far.
  
  @param offset The offset extracted from the compressed reference
  @param chunkSizeSoFar The number of bytes read so far from this chunk
  @throws DecompressionException if the offset is invalid