Slice returns a new Reader containing the Next n bytes from this Reader. If you want to make a new Reader using the []byte returned by Next, Slice already does that, and the operation is zero-copy. Besides, Slice would also Release this Reader. The logic pseudocode is similar: var p, err = this.Ne
(n int)
| 95 | // return reader, err |
| 96 | // |
| 97 | Slice(n int) (r Reader, err error) |
| 98 | |
| 99 | // Release the memory space occupied by all read slices. This method needs to be executed actively to |
| 100 | // recycle the memory after confirming that the previously read data is no longer in use. |
no outgoing calls