MCPcopy Create free account
hub / github.com/Merovius/nbd / writeString

Method writeString

handshake.go:360–372  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

358}
359
360func (e *encoder) writeString(s string) {
361 if e.buf != nil {
362 e.buf = append(e.buf, s...)
363 return
364 }
365 var err error
366 if sw, ok := e.rw.(interface{ WriteString(string) (int, error) }); ok {
367 _, err = sw.WriteString(s)
368 } else {
369 _, err = e.rw.Write([]byte(s))
370 }
371 e.check(err)
372}
373
374func (e *encoder) read(b []byte) {
375 _, err := io.ReadFull(e.rw, b)

Callers 4

encodeMethod · 0.80
encodeMethod · 0.80
encodeMethod · 0.80
encodeMethod · 0.80

Calls 1

WriteMethod · 0.80

Tested by

no test coverage detected