| 452 | |
| 453 | |
| 454 | void ClumpletWriter::insertEndMarker(UCHAR tag) |
| 455 | { |
| 456 | // Check that we're not beyond the end of buffer. |
| 457 | // We get there when we set end marker. |
| 458 | if (cur_offset > dynamic_buffer.getCount()) |
| 459 | { |
| 460 | usage_mistake("write past EOF"); |
| 461 | return; |
| 462 | } |
| 463 | |
| 464 | // Check that resulting data doesn't overflow size limit |
| 465 | size_overflow(cur_offset + 1 > sizeLimit); |
| 466 | |
| 467 | dynamic_buffer.shrink(cur_offset); |
| 468 | dynamic_buffer.push(tag); |
| 469 | |
| 470 | cur_offset += 2; // Go past EOF to indicate we set the marker |
| 471 | } |
| 472 | |
| 473 | void ClumpletWriter::deleteClumplet() |
| 474 | { |