MCPcopy Index your code
hub / github.com/aceld/zinx / decode

Method decode

zdecoder/ltvdecoder_little.go:98–112  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

96}
97
98func (ltv *LTV_Little_Decoder) decode(data []byte) *LTV_Little_Decoder {
99 ltvData := LTV_Little_Decoder{}
100
101 //Get L
102 ltvData.Length = binary.LittleEndian.Uint32(data[0:4])
103 //Get T
104 ltvData.Tag = binary.LittleEndian.Uint32(data[4:8])
105 //Determine the length of V. (确定V的长度)
106 ltvData.Value = make([]byte, ltvData.Length)
107
108 //5. Get V
109 binary.Read(bytes.NewBuffer(data[8:8+ltvData.Length]), binary.LittleEndian, ltvData.Value)
110
111 return &ltvData
112}
113
114func (ltv *LTV_Little_Decoder) Intercept(chain ziface.IChain) ziface.IcResp {
115 //1. Get the IMessage of zinx

Callers 1

InterceptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected