Reset resets decoder, preparing it for the next run.
()
| 134 | |
| 135 | // Reset resets decoder, preparing it for the next run. |
| 136 | func (d *Decoder) Reset() { |
| 137 | d.fd = nil |
| 138 | d.completed = false |
| 139 | d.chunkLen = 0 |
| 140 | d.total = 0 |
| 141 | d.cache = map[string]struct{}{} |
| 142 | d.codec = nil |
| 143 | } |
| 144 | |
| 145 | // isCached takes the header of chunk data and see if it's been cached. |
| 146 | // If not, it caches it. |