Method
ReadOnReady
(bufSize int, pool mem.BufferPool)
Source from the content-addressed store, hash-verified
| 142 | } |
| 143 | |
| 144 | func (c *blockingReader) ReadOnReady(bufSize int, pool mem.BufferPool) (*[]byte, int, error) { |
| 145 | buf := pool.Get(bufSize) |
| 146 | n, err := c.reader.Read(*buf) |
| 147 | if err != nil { |
| 148 | pool.Put(buf) |
| 149 | return nil, 0, err |
| 150 | } |
| 151 | return buf, n, nil |
| 152 | } |
| 153 | |
| 154 | // New detects if [syscall.RawConn] is available for non-memory-pinning reads. |
| 155 | // If [syscall.RawConn] is unavailable, it falls back to using the simpler |
Callers
nothing calls this directly
Tested by
no test coverage detected