MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / readStringNonCopy

Method readStringNonCopy

protocol/nbt/qnbt/primitive.go:192–208  ·  view source on GitHub ↗
(dst *string)

Source from the content-addressed store, hash-verified

190}
191
192func (d *Decoder) readStringNonCopy(dst *string) error {
193 l, err := d.readShort()
194 if err != nil {
195 return err
196 }
197
198 if err := d.rd.fill(int(l)); err != nil {
199 return err
200 }
201
202 buf := d.rd.buf[d.rd.r : d.rd.r+int(l)]
203 d.rd.r += int(l)
204
205 *dst = unsafe.String(unsafe.SliceData(buf), len(buf))
206
207 return nil
208}
209
210func (d *Decoder) readStringPtr(dst unsafe.Pointer) error {
211 return d.readString((*string)(dst))

Callers 2

decodeMapStringMethod · 0.95
decodeStructCompoundMethod · 0.95

Calls 3

readShortMethod · 0.95
fillMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected