code: func (up *Unsubscribe) Decode(src []byte) (int, error) {
  	total := 0
  
  	// decode header
  	hl, _, rl, err := headerDecode(src[total:], UNSUBSCRIBE)
  	total += hl
  	if err != nil {
  		return total, err
  	}
  
  	// check buffer length
  	if len(src) < total+2 {
  		return total, makeError(up.Type(), "insufficient buffer size, expected %d, got %d", total+2, len(src))
  	}
  
  	// read packet id
  	up.ID = ID(binary.BigEndian.Uint16(src[total:]))
  	total += 2
  
  	// check packet id
  	if !up.ID.Valid() {
  		return total, makeError(up.Type(), "packet id must be grater than zero")
  	}
  
  	// prepare counter
  	tl := int(rl) - 2
  
  	// reset topics
  	up.Topics = up.Topics[:0]
  
  	for tl > 0 {
  		// read topic
  		t, n, err := readLPString(src[total:], up.Type())
  		total += n
  		if err != nil {
  			return total, err
  		}
  
  		// append to list
  		up.Topics = append(up.Topics, t)
  
  		// decrement counter
  		tl = tl - n - 1
  	}
  
  	// check for empty list
  	if len(up.Topics) == 0 {
  		return total, makeError(up.Type(), "empty topic list")
  	}
  
  	return total, nil
  }
docs: // Decode reads from the byte slice argument. It returns the total number of
  // bytes decoded, and whether there have been any errors during the process.