| 457 | } |
| 458 | |
| 459 | BOOL LASwritePoint::write_chunk_table() |
| 460 | { |
| 461 | U32 i; |
| 462 | I64 position = outstream->tell(); |
| 463 | if (chunk_table_start_position != -1) // stream is seekable |
| 464 | { |
| 465 | if (!outstream->seek(chunk_table_start_position)) |
| 466 | { |
| 467 | return FALSE; |
| 468 | } |
| 469 | if (!outstream->put64bitsLE((U8*)&position)) |
| 470 | { |
| 471 | return FALSE; |
| 472 | } |
| 473 | if (!outstream->seek(position)) |
| 474 | { |
| 475 | return FALSE; |
| 476 | } |
| 477 | } |
| 478 | U32 version = 0; |
| 479 | if (!outstream->put32bitsLE((U8*)&version)) |
| 480 | { |
| 481 | return FALSE; |
| 482 | } |
| 483 | if (!outstream->put32bitsLE((U8*)&number_chunks)) |
| 484 | { |
| 485 | return FALSE; |
| 486 | } |
| 487 | if (number_chunks > 0) |
| 488 | { |
| 489 | enc->init(outstream); |
| 490 | IntegerCompressor ic(enc, 32, 2); |
| 491 | ic.initCompressor(); |
| 492 | for (i = 0; i < number_chunks; i++) |
| 493 | { |
| 494 | if (chunk_size == U32_MAX) ic.compress((i ? chunk_sizes[i-1] : 0), chunk_sizes[i], 0); |
| 495 | ic.compress((i ? chunk_bytes[i-1] : 0), chunk_bytes[i], 1); |
| 496 | } |
| 497 | enc->done(); |
| 498 | } |
| 499 | if (chunk_table_start_position == -1) // stream is not-seekable |
| 500 | { |
| 501 | if (!outstream->put64bitsLE((U8*)&position)) |
| 502 | { |
| 503 | return FALSE; |
| 504 | } |
| 505 | } |
| 506 | return TRUE; |
| 507 | } |
| 508 | |
| 509 | LASwritePoint::~LASwritePoint() |
| 510 | { |
nothing calls this directly
no test coverage detected