MCPcopy
hub / github.com/gorilla/websocket / Read

Method Read

compression.go:126–138  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

124}
125
126func (r *flateReadWrapper) Read(p []byte) (int, error) {
127 if r.fr == nil {
128 return 0, io.ErrClosedPipe
129 }
130 n, err := r.fr.Read(p)
131 if err == io.EOF {
132 // Preemptively place the reader back in the pool. This helps with
133 // scenarios where the application does not call NextReader() soon after
134 // this final read.
135 r.Close()
136 }
137 return n, err
138}
139
140func (r *flateReadWrapper) Close() error {
141 if r.fr == nil {

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.95

Tested by

no test coverage detected