code: public byte[] compress(byte[] src, int srcOff, int srcLen) {
      final int maxCompressedLength = maxCompressedLength(srcLen);
      final byte[] compressed = new byte[maxCompressedLength];
      final int compressedLength = compress(src, srcOff, srcLen, compressed, 0);
      return Arrays.copyOf(compressed, compressedLength);
    }
docs: Convenience method which returns <code>src[srcOff:srcOff+srcLen]</code>
  compressed.
  <p><b><span style="color:red">Warning</span></b>: this method has an
  important overhead due to the fact that it needs to allocate a buffer to
  compress into, and then needs to resize this buffer to the actual
  compressed length.</p>
  <p>Here is how this method is implemented:</p>
  <pre>
  final int maxCompressedLength = maxCompressedLength(srcLen);
  final byte[] compressed = new byte[maxCompressedLength];
  final int compressedLength = compress(src, srcOff, srcLen, compressed, 0);
  return Arrays.copyOf(compressed, compressedLength);
  </pre>
  
  @param src the source data
  @param srcOff the start offset in src
  @param srcLen the number of bytes to compress
  @return the compressed data