(src *bufio.Reader, noQuotes bool)
| 195 | } |
| 196 | |
| 197 | func decodeString(src *bufio.Reader, noQuotes bool) []byte { |
| 198 | pb := readByte(src) |
| 199 | major := pb & maskOutAdditionalType |
| 200 | minor := pb & maskOutMajorType |
| 201 | if major != majorTypeByteString { |
| 202 | panic(fmt.Errorf("Major type is: %d in decodeString", major)) |
| 203 | } |
| 204 | result := []byte{} |
| 205 | if !noQuotes { |
| 206 | result = append(result, '"') |
| 207 | } |
| 208 | length := decodeIntAdditionalType(src, minor) |
| 209 | len := int(length) |
| 210 | pbs := readNBytes(src, len) |
| 211 | result = append(result, pbs...) |
| 212 | if noQuotes { |
| 213 | return result |
| 214 | } |
| 215 | return append(result, '"') |
| 216 | } |
| 217 | func decodeStringToDataUrl(src *bufio.Reader, mimeType string) []byte { |
| 218 | pb := readByte(src) |
| 219 | major := pb & maskOutAdditionalType |
no test coverage detected