code: public static DoubleHistogram decodeFromByteBuffer(
              final ByteBuffer buffer,
              final Class<? extends AbstractHistogram> internalCountsHistogramClass,
              long minBarForHighestToLowestValueRatio) {
          try {
              int cookie = buffer.getInt();
              if (!isNonCompressedDoubleHistogramCookie(cookie)) {
                  throw new IllegalArgumentException("The buffer does not contain a DoubleHistogram");
              }
              DoubleHistogram histogram = constructHistogramFromBuffer(cookie, buffer, internalCountsHistogramClass,
                      minBarForHighestToLowestValueRatio);
              return histogram;
          } catch (DataFormatException ex) {
              throw new RuntimeException(ex);
          }
      }
docs: Construct a new DoubleHistogram by decoding it from a ByteBuffer, using a
  specified AbstractHistogram subclass for tracking internal counts (e.g. {@link org.HdrHistogram_voltpatches.Histogram},
  {@link org.HdrHistogram_voltpatches.ConcurrentHistogram}, {@link org.HdrHistogram_voltpatches.SynchronizedHistogram},
  {@link org.HdrHistogram_voltpatches.IntCountsHistogram}, {@link org.HdrHistogram_voltpatches.ShortCountsHistogram}).
  
  @param buffer The buffer to decode from
  @param internalCountsHistogramClass The class to use for internal counts tracking
  @param minBarForHighestToLowestValueRatio Force highestTrackableValue to be set at least this high
  @return The newly constructed DoubleHistogram