MCPcopy Create free account
hub / github.com/TyphoonMC/TyphoonCore / ReadString

Method ReadString

utils.go:208–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206}
207
208func (player *Player) ReadString() (s string, err error) {
209 length, err := player.ReadVarInt()
210 if err != nil {
211 return "", err
212 }
213 buffer := make([]byte, length)
214 _, err = io.ReadFull(player.io.rdr, buffer)
215 if err != nil {
216 return "", err
217 }
218 return string(buffer), nil
219}
220
221func (player *Player) ReadStringLimited(max int) (s string, err error) {
222 max = (max * 4) + 3

Callers

nothing calls this directly

Calls 1

ReadVarIntMethod · 0.95

Tested by

no test coverage detected