This repository was archived by the owner on May 8, 2026. It is now read-only.
Commit 54b6848
committed
Add getDataSize() to DocumentSnapshot
This method calculates and returns the total size of the data stored in the DocumentSnapshot in bytes.
- Iterates through the protobuf `Value` messages in the `fields` map.
- Sums the `getSerializedSize()` of each `Value`.
- Returns 0 if the document does not exist (fields is null).1 parent 7920b5b commit 54b6848
2 files changed
Lines changed: 36 additions & 0 deletions
File tree
- google-cloud-firestore/src
- main/java/com/google/cloud/firestore
- test/java/com/google/cloud/firestore
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
471 | 488 | | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1524 | 1543 | | |
0 commit comments