code: public static int uncompressedLength(ByteBuffer compressed)
              throws IOException
      {
          if (!compressed.isDirect()) {
              throw new SnappyError(SnappyErrorCode.NOT_A_DIRECT_BUFFER, "input is not a direct buffer");
          }
  
          return impl.uncompressedLength(compressed, compressed.position(), compressed.remaining());
      }
docs: Get the uncompressed byte size of the given compressed input. This
  operation takes O(1) time.
  
  @param compressed input data [pos() ... limit())
  @return uncompressed byte length of the given input
  @throws IOException when failed to uncompress the given input. The error code is
  {@link SnappyErrorCode#PARSING_ERROR}
  @throws SnappyError when the input is not a direct buffer