()
| 1075 | } |
| 1076 | |
| 1077 | func (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 | |
| 1093 | func (d *Decoder) readByteArray() ([]byte, error) { |
| 1094 | l, err := d.readInt() |
no test coverage detected