code: func (h *HLLPP) Marshal() []byte {
  	if h.sparse {
  		h.flushTmpSet()
  	}
  
  	buf := make([]byte, marshalHeaderSize+len(h.data))
  
  	offset := 0
  
  	binary.BigEndian.PutUint16(buf[offset:], marshalVersion)
  	offset += 2
  
  	binary.BigEndian.PutUint32(buf[offset:], uint32(len(buf)))
  	offset += 4
  
  	var flags uint16
  	if h.sparse {
  		flags |= marshalFlagSparse
  	}
  
  	binary.BigEndian.PutUint16(buf[offset:], flags)
  	offset += 2
  
  	buf[offset] = h.p
  	offset += 1
  
  	buf[offset] = h.pp
  	offset += 1
  
  	binary.BigEndian.PutUint32(buf[offset:], h.sparseLength)
  	offset += 4
  
  	buf[offset] = byte(h.bitsPerRegister)
  	offset += 1
  
  	copy(buf[offset:], h.data)
  
  	return buf
  }
docs: // Marshal serializes h into a byte slice that can be deserialized via
  // Unmarshal. The data is naturally compressed, so don't bother trying
  // to compress it any more.