Len returns the length of the SourceDescriptionItem when encoded as binary.
()
| 288 | |
| 289 | // Len returns the length of the SourceDescriptionItem when encoded as binary. |
| 290 | func (s SourceDescriptionItem) Len() int { |
| 291 | /* |
| 292 | * 0 1 2 3 |
| 293 | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 294 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 295 | * | CNAME=1 | length | user and domain name ... |
| 296 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 297 | */ |
| 298 | return sdesTypeLen + sdesOctetCountLen + len([]byte(s.Text)) |
| 299 | } |
| 300 | |
| 301 | // Marshal encodes the SourceDescriptionItem in binary. |
| 302 | func (s SourceDescriptionItem) Marshal() ([]byte, error) { |