Len returns the number of bytes in the buffer.
()
| 114 | |
| 115 | // Len returns the number of bytes in the buffer. |
| 116 | func (b *Buffer) Len() int { |
| 117 | copy := *b |
| 118 | copy.finalize() |
| 119 | return len(copy.buf) |
| 120 | } |
| 121 | |
| 122 | // Cap returns the capacity of the buffer's underlying byte slice, |
| 123 | // that is, the total space allocated for the buffer's data. |