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

Method readString

protocol/nbt/decoder.go:1077–1091  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1075}
1076
1077func (d *Decoder) readString() (string, error) {
1078 l, err := d.readShort()
1079
1080 if err != nil {
1081 return "", err
1082 }
1083
1084 if l < 0 {
1085 return "", fmt.Errorf("negative length for make (read string)")
1086 }
1087
1088 var data = make([]byte, l)
1089 _, err = d.rd.Read(data)
1090 return string(data), err
1091}
1092
1093func (d *Decoder) readByteArray() ([]byte, error) {
1094 l, err := d.readInt()

Callers 7

DecodeRootCompoundMethod · 0.95
DecodeMethod · 0.95
decodeCompoundMapMethod · 0.95
decodeCompoundStructMethod · 0.95
decodeListMethod · 0.95
decodeCompoundMethod · 0.95
_decodeListMethod · 0.95

Calls 2

readShortMethod · 0.95
ReadMethod · 0.45

Tested by

no test coverage detected