code: @Override
      public void writeMetadata(final byte[] bytes, final IHLLMetadata metadata) {
          final HLLType type = metadata.HLLType();
          final int typeOrdinal = getOrdinal(type);
  
          final int explicitCutoffValue;
          if(metadata.explicitOff()) {
              explicitCutoffValue = EXPLICIT_OFF;
          } else if(metadata.explicitAuto()) {
              explicitCutoffValue = EXPLICIT_AUTO;
          } else {
              explicitCutoffValue = metadata.log2ExplicitCutoff() + 1/*per spec*/;
          }
  
          bytes[0] = SerializationUtil.packVersionByte(SCHEMA_VERSION, typeOrdinal);
          bytes[1] = SerializationUtil.packParametersByte(metadata.registerWidth(), metadata.registerCountLog2());
          bytes[2] = SerializationUtil.packCutoffByte(explicitCutoffValue, metadata.sparseEnabled());
      }
docs: /* (non-Javadoc)
  @see net.agkn.hll.serialization.ISchemaVersion#writeMetadata(byte[], IHLLMetadata)