toMeshPacket
Decode a MeshPacket from raw wire bytes. Returns null if this is not a valid MeshPacket proto encoding (any decoding Throwable is swallowed).
Useful when persisting captured packets in arbitrary byte storage and rehydrating later, or when bridging to a non-SDK transport that hands you bytes directly.
Example:
val bytes: ByteArray = readFromCapture()
val packet = bytes.toMeshPacket() ?: error("not a MeshPacket")Content copied to clipboard
Since
0.1.0