code: public byte[] toByteArray(final ArrayOfItemsSerDe<? super T> serDe) {
      if ((r_ == 0) && (h_ == 0)) {
        // null class is ok since empty -- no need to call serDe
        return toByteArray(serDe, null);
      } else {
        final int validIndex = (h_ == 0 ? 1 : 0);
        final Class<?> clazz = data_.get(validIndex).getClass();
        return toByteArray(serDe, clazz);
      }
    }
docs: Returns a byte array representation of this sketch. May fail for polymorphic item types.
  
  @param serDe An instance of ArrayOfItemsSerDe
  @return a byte array representation of this sketch