Source File
decoder.go
Belonging Package
encoding/gob
package gob
import (
)
type Decoder struct {
mutex sync.Mutex // each item must be received atomically
r io.Reader // source of the data
buf decBuffer // buffer for more efficient i/o from r
wireType map[typeId]*wireType // map from remote ID to local description
decoderCache map[reflect.Type]map[typeId]**decEngine // cache of compiled engines
ignorerCache map[typeId]**decEngine // ditto for ignored objects
freeList *decoderState // list of free decoderStates; avoids reallocation
countBuf []byte // used for decoding integers while parsing messages
err error
}
.wireType[] =
}
var errBadCount = errors.New("invalid message length")
, , := decodeUintReader(.r, .countBuf)
if != nil {
.err =
return false
}
if >= tooBig {
.err = errBadCount
return false
}
.readMessage(int())
return .err == nil
}
panic("non-empty decoder buffer")
return
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |