public static KllFloatsSketch deserializeKll(InputStream in) throws IOException {
    final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    final byte[] data = new byte[4];
    int nRead;

    while ((nRead = in.read(data, 0, data.length)) != -1) {
      buffer.write(data, 0, nRead);
    }

    buffer.flush();
    return KllFloatsSketch.heapify(Memory.wrap(buffer.toByteArray()));
  }
This function deserializes the serialized KLL sketch from a stream.
@param in input stream to be deserialized
@return KLL sketch
@throws IOException if errors occur while reading the stream
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/common/histogram/kll/KllUtils.java