(p []byte)
| 99 | } |
| 100 | |
| 101 | func (a *autoDecodeReadCloser) Read(p []byte) (n int, err error) { |
| 102 | if !a.detected { |
| 103 | return a.peekRead(p) |
| 104 | } |
| 105 | if a.peek != nil { |
| 106 | return a.peekDrain(p) |
| 107 | } |
| 108 | if a.decodeReader != nil { |
| 109 | return a.decodeReader.Read(p) |
| 110 | } |
| 111 | return a.ReadCloser.Read(p) // can not determine charset, not decode |
| 112 | } |