MCPcopy Create free account
hub / github.com/cloudwego/dynamicgo / ReadBytes

Method ReadBytes

proto/binary/binary.go:932–939  ·  view source on GitHub ↗

ReadBytes return bytesData and the sum length of L、V in TLV

()

Source from the content-addressed store, hash-verified

930
931// ReadBytes return bytesData and the sum length of L、V in TLV
932func (p *BinaryProtocol) ReadBytes() ([]byte, error) {
933 value, n, all := protowire.BinaryDecoder{}.DecodeBytes((p.Buf)[p.Read:])
934 if n < 0 {
935 return emptyBuf[:], errDecodeField
936 }
937 _, err := p.next(all)
938 return value, err
939}
940
941// ReadLength return dataLength, and move pointer in the begin of data
942func (p *BinaryProtocol) ReadLength() (int, error) {

Callers 2

ReadBaseTypeWithDescMethod · 0.95
unmarshalSingularMethod · 0.80

Calls 2

nextMethod · 0.95
DecodeBytesMethod · 0.45

Tested by

no test coverage detected