()
| 219 | } |
| 220 | |
| 221 | public @NotNull JsonWriter clear() { // leave the empty head block |
| 222 | Block head = ensureNotNull(tail.next); |
| 223 | for (Block block = head.next; block != head; block = block.next) |
| 224 | allocator.free(ensureNotNull(block)); |
| 225 | tail = head; |
| 226 | head.next = head; |
| 227 | buf = head.buf; |
| 228 | pos = 0; |
| 229 | size = 0; |
| 230 | tabs = 0; |
| 231 | return this; |
| 232 | } |
| 233 | |
| 234 | public @NotNull JsonWriter free() { // can be reused by ensure() |
| 235 | for (Block block = tail.next; ; block = block.next) { |