code: func Unmarshal(input []byte) (BitArray, error) {
  	if len(input) == 0 {
  		return nil, errors.New("no data in input")
  	}
  	if input[0] == 'B' {
  		ret := newBitArray(0)
  		err := ret.Deserialize(input)
  		if err != nil {
  			return nil, err
  		}
  		return ret, nil
  	} else if input[0] == 'S' {
  		ret := newSparseBitArray()
  		err := ret.Deserialize(input)
  		if err != nil {
  			return nil, err
  		}
  		return ret, nil
  	} else {
  		return nil, errors.New("unrecognized encoding")
  	}
  }
docs: // Unmarshal takes a byte slice, of the same format produced by Marshal,
  // and returns a BitArray.