MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / ReadBytes

Method ReadBytes

utils/binary/reader.go:137–147  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

135}
136
137func (r *Reader) ReadBytes(length int) (v []byte) {
138 // 返回一个全新的数组罢
139 v = make([]byte, length)
140 if r.reader != nil {
141 _, _ = r.reader.Read(v)
142 } else {
143 copy(v, r.buffer[r.pos:r.pos+length])
144 r.pos += length
145 }
146 return
147}
148
149func (r *Reader) ReadString(length int) string {
150 return utils.B2S(r.ReadBytes(length))

Callers 9

readSSOFrameMethod · 0.95
UnmarshalMethod · 0.95
ReadBytesNoCopyMethod · 0.95
ReadStringMethod · 0.95
ReadBytesWithLengthMethod · 0.95
ReadTlvMethod · 0.95
ParseMessageElementsFunction · 0.95
decodeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected