code: func (b *Bitmap) UnmarshalBinary(data []byte) error {
  	if data == nil {
  		// Nothing to unmarshal
  		return nil
  	}
  	statsHit("Bitmap/UnmarshalBinary")
  	b.opN = 0 // reset opN since we're reading new data.
  	fileMagic := uint32(binary.LittleEndian.Uint16(data[0:2]))
  	if fileMagic == MagicNumber { // if pilosa roaring
  		return errors.Wrap(b.unmarshalPilosaRoaring(data), "unmarshaling as pilosa roaring")
  	}
  
  	keyN, containerTyper, header, pos, haveRuns, err := readOfficialHeader(data)
  	if err != nil {
  		return errors.Wrap(err, "reading roaring header")
  	}
  
  	b.Containers.Reset()
  	// Descriptive header section: Read container keys and cardinalities.
  	for i, buf := uint(0), data[header:]; i < uint(keyN); i, buf = i+1, buf[4:] {
  		card := int(binary.LittleEndian.Uint16(buf[2:4])) + 1
  		b.Containers.PutContainerValues(
  			uint64(binary.LittleEndian.Uint16(buf[0:2])),
  			containerTyper(i, card), /// container type voodo with isRunBitmap
  			card,
  			true)
  	}
  
  	// Read container offsets and attach data.
  	if haveRuns {
  		readWithRuns(b, data, pos, keyN)
  	} else {
  		err := readOffsets(b, data, pos, keyN)
  		if err != nil {
  			return errors.Wrap(err, "reading offsets from official roaring format")
  		}
  	}
  	return nil
  }
docs: // UnmarshalBinary decodes b from a binary-encoded byte slice. data can be in
  // either official roaring format or Pilosa's roaring format.