MCPcopy
hub / github.com/nats-io/nats.go / nextBuf

Method nextBuf

ws.go:133–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131}
132
133func (d *wsDecompressor) nextBuf() []byte {
134 // We still have remaining data in the first buffer
135 if d.off != len(d.bufs[0]) {
136 return d.bufs[0]
137 }
138 // We read the full first buffer. Reset offset.
139 d.off = 0
140 // We were at the last buffer, so we are done.
141 if len(d.bufs) == 1 {
142 d.bufs = nil
143 return nil
144 }
145 // Here we move to the next buffer.
146 d.bufs = d.bufs[1:]
147 return d.bufs[0]
148}
149
150func (d *wsDecompressor) ReadByte() (byte, error) {
151 if len(d.bufs) == 0 {

Callers 2

ReadMethod · 0.95
ReadByteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected