Source File
chunkreader.go
Belonging Package
github.com/jackc/chunkreader/v2
package chunkreader
import (
)
func ( io.Reader, Config) (*ChunkReader, error) {
if len(.buf) < {
.copyBufContents(.newBuf())
}
:= - (.wp - .rp)
if (len(.buf) - .wp) < {
:= .newBuf()
.copyBufContents()
}
if := .appendAtLeast(); != nil {
return nil,
}
= .buf[.rp : .rp+]
.rp +=
return , nil
}
func ( *ChunkReader) ( int) error {
, := io.ReadAtLeast(.r, .buf[.wp:], )
.wp +=
return
}
func ( *ChunkReader) ( int) []byte {
if < .config.MinBufLen {
= .config.MinBufLen
}
return make([]byte, )
}
func ( *ChunkReader) ( []byte) {
.wp = copy(, .buf[.rp:.wp])
.rp = 0
.buf =
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |