readFlush returns a slice of the historical buffer that is ready to be emitted to the user. The data returned by readFlush must be fully consumed before calling any other dictDecoder methods.
()
| 182 | // emitted to the user. The data returned by readFlush must be fully consumed |
| 183 | // before calling any other dictDecoder methods. |
| 184 | func (dd *dictDecoder) readFlush() []byte { |
| 185 | toRead := dd.hist[dd.rdPos:dd.wrPos] |
| 186 | dd.flushed += int64(len(toRead)) |
| 187 | dd.rdPos = dd.wrPos |
| 188 | if dd.wrPos == len(dd.hist) { |
| 189 | dd.wrPos, dd.rdPos = 0, 0 |
| 190 | dd.full = true |
| 191 | } |
| 192 | return toRead |
| 193 | } |
| 194 | |
| 195 | // decoded reports the total number of bytes written into the dictionary since |
| 196 | // init (i.e. excluding any preset dict bytes). |
no outgoing calls