(r io.Reader)
| 358 | } |
| 359 | |
| 360 | func (d *Decoder) switchToReader(r io.Reader) { |
| 361 | // Get efficient byte at a time reader. |
| 362 | // Assume that if reader has its own |
| 363 | // ReadByte, it's efficient enough. |
| 364 | // Otherwise, use bufio. |
| 365 | if rb, ok := r.(io.ByteReader); ok { |
| 366 | d.r = rb |
| 367 | } else { |
| 368 | d.r = bufio.NewReader(r) |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | // Parsing state - stack holds old name space translations |
| 373 | // and the current set of open elements. The translations to pop when |
no outgoing calls
no test coverage detected