func createValueDump(t byte, val []byte) []byte { var b bytes.Buffer c := digest.New() w := io.MultiWriter(&b, c) w.Write([]byte{t}) w.Write(val) binary.Write(w, binary.LittleEndian, uint16(Version)) binary.Write(w, binary.LittleEndian, c.Sum64()) return b.Bytes() }
func NewLoader(r io.Reader) *Loader { l := &Loader{} l.crc = digest.New() l.rdbReader = newRdbReader(io.TeeReader(r, l.crc)) return l }