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

Method decode

types.go:249–261  ·  view source on GitHub ↗
(e *encoder, l uint32)

Source from the content-addressed store, hash-verified

247}
248
249func (r *repServer) decode(e *encoder, l uint32) {
250 if l < 4 {
251 e.check(errors.New("invalid server response"))
252 }
253 length := e.uint32()
254 if length > l-4 {
255 e.check(errors.New("invalid server response"))
256 }
257 b := make([]byte, l-4)
258 e.read(b)
259 r.name = string(b[:length])
260 r.details = string(b[length:])
261}
262
263const (
264 cInfoExport = 0

Callers

nothing calls this directly

Calls 2

uint32Method · 0.80
readMethod · 0.80

Tested by

no test coverage detected