------------------------------------------ implement zero-copy reader ------------------------------------------ Next implements Connection.
(n int)
| 136 | |
| 137 | // Next implements Connection. |
| 138 | func (c *connection) Next(n int) (p []byte, err error) { |
| 139 | if err = c.waitRead(n); err != nil { |
| 140 | return p, err |
| 141 | } |
| 142 | return c.inputBuffer.Next(n) |
| 143 | } |
| 144 | |
| 145 | // Peek implements Connection. |
| 146 | func (c *connection) Peek(n int) (buf []byte, err error) { |