()
| 158 | } |
| 159 | |
| 160 | func (r *compactReader) ReadMap() (Map, error) { |
| 161 | n, err := r.readUvarint("map size", math.MaxInt32) |
| 162 | if err != nil { |
| 163 | return Map{}, err |
| 164 | } |
| 165 | if n == 0 { // empty map |
| 166 | return Map{}, nil |
| 167 | } |
| 168 | b, err := r.ReadByte() |
| 169 | if err != nil { |
| 170 | return Map{}, dontExpectEOF(err) |
| 171 | } |
| 172 | return Map{Size: int32(n), Key: Type(b >> 4), Value: Type(b & 0xF)}, nil |
| 173 | } |
| 174 | |
| 175 | func (r *compactReader) ReadByte() (byte, error) { |
| 176 | return r.binary.ReadByte() |
nothing calls this directly
no test coverage detected