MCPcopy Create free account
hub / github.com/XTLS/REALITY / atLeastReader

Struct atLeastReader

conn.go:844–847  ·  view source on GitHub ↗

atLeastReader reads from R, stopping with EOF once at least N bytes have been read. It is different from an io.LimitedReader in that it doesn't cut short the last Read call, and in that it considers an early EOF an error.

Source from the content-addressed store, hash-verified

842// read. It is different from an io.LimitedReader in that it doesn't cut short
843// the last Read call, and in that it considers an early EOF an error.
844type atLeastReader struct {
845 R io.Reader
846 N int64
847}
848
849func (r *atLeastReader) Read(p []byte) (int, error) {
850 if r.N <= 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected