takeCompleteBuffer returns the complete existing buffer. This can be used if the necessary buffer size is unknown. cap and len of the returned buffer will be equal. Only one buffer (total) can be used at a time.
()
| 135 | // cap and len of the returned buffer will be equal. |
| 136 | // Only one buffer (total) can be used at a time. |
| 137 | func (b *buffer) takeCompleteBuffer() ([]byte, error) { |
| 138 | if b.busy() { |
| 139 | return nil, ErrBusyBuffer |
| 140 | } |
| 141 | return b.cachedBuf, nil |
| 142 | } |
| 143 | |
| 144 | // store stores buf, an updated buffer, if its suitable to do so. |
| 145 | func (b *buffer) store(buf []byte) { |
no test coverage detected