(r io.Reader)
| 348 | } |
| 349 | |
| 350 | func (d *Decoder) switchToReader(r io.Reader) { |
| 351 | // Get efficient byte at a time reader. |
| 352 | // Assume that if reader has its own |
| 353 | // ReadByte, it's efficient enough. |
| 354 | // Otherwise, use bufio. |
| 355 | if rb, ok := r.(io.ByteReader); ok { |
| 356 | d.r = rb |
| 357 | } else { |
| 358 | d.r = bufio.NewReader(r) |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | // Parsing state - stack holds old name space translations |
| 363 | // and the current set of open elements. The translations to pop when |
no outgoing calls
no test coverage detected