code: public static int getMaxSerializedSizeBytes(final int k, final long n) {
      final int numLevels = KllHelper.ubOnNumLevels(n);
      final int maxNumItems = KllHelper.computeTotalCapacity(k, DEFAULT_M, numLevels);
      return getSerializedSizeBytes(numLevels, maxNumItems);
    }
docs: Returns upper bound on the serialized size of a sketch given a parameter <em>k</em> and stream
  length. The resulting size is an overestimate to make sure actual sketches don't exceed it.
  This method can be used if allocation of storage is necessary beforehand, but it is not
  optimal.
  @param k parameter that controls size of the sketch and accuracy of estimates
  @param n stream length
  @return upper bound on the serialized size