NOTE assert and use with caution.
(p []byte, off int64)
| 243 | |
| 244 | // NOTE assert and use with caution. |
| 245 | func (z *SGL) WriteAt(p []byte, off int64) (n int, err error) { |
| 246 | debug.Assert(z.woff >= off+int64(len(p))) |
| 247 | |
| 248 | prevWriteOff := z.woff |
| 249 | z.woff = off |
| 250 | n, err = z.Write(p) |
| 251 | z.woff = prevWriteOff |
| 252 | return n, err |
| 253 | } |
| 254 | |
| 255 | // reuse already allocated SGL (compare with Reader below) |
| 256 | func (z *SGL) Reset() { z.woff, z.roff = 0, 0 } |
no test coverage detected