| 96 | } |
| 97 | |
| 98 | func (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 <vData |
| 112 | } |
| 113 | |
| 114 | func (ltv *LTV_Little_Decoder) Intercept(chain ziface.IChain) ziface.IcResp { |
| 115 | //1. Get the IMessage of zinx |