code: func (ba *bitArray) Serialize() ([]byte, error) {
  	w := new(bytes.Buffer)
  
  	var identifier uint8 = 'B'
  	err := binary.Write(w, binary.LittleEndian, identifier)
  	if err != nil {
  		return nil, err
  	}
  
  	err = binary.Write(w, binary.LittleEndian, ba.lowest)
  	if err != nil {
  		return nil, err
  	}
  	err = binary.Write(w, binary.LittleEndian, ba.highest)
  	if err != nil {
  		return nil, err
  	}
  
  	var encodedanyset uint8
  	if ba.anyset {
  		encodedanyset = 1
  	} else {
  		encodedanyset = 0
  	}
  	err = binary.Write(w, binary.LittleEndian, encodedanyset)
  	if err != nil {
  		return nil, err
  	}
  
  	err = binary.Write(w, binary.LittleEndian, ba.blocks)
  	if err != nil {
  		return nil, err
  	}
  	return w.Bytes(), nil
  }
docs: // Serialize converts the bitArray to a byte slice.