MCPcopy Create free account
hub / github.com/segmentio/encoding / ReadLength

Method ReadLength

thrift/binary.go:102–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102func (r *binaryReader) ReadLength() (int, error) {
103 b, err := r.read(4)
104 if len(b) < 4 {
105 return 0, err
106 }
107 n := binary.BigEndian.Uint32(b)
108 if n > math.MaxInt32 {
109 return 0, fmt.Errorf("length out of range: %d", n)
110 }
111 return int(n), nil
112}
113
114func (r *binaryReader) ReadMessage() (Message, error) {
115 m := Message{}

Callers 1

ReadBytesMethod · 0.95

Calls 2

readMethod · 0.95
Uint32Method · 0.80

Tested by

no test coverage detected