toBytes

suspend fun toBytes(): ByteArray

Serializes this document's full restorable state — root, presences, checkpoint, changeID, pending changes, compaction epoch, and docId — into a self-contained byte envelope. The reverse of Companion.fromBytes.