Package protocols.apps.canvas
Class CanvasPayload
java.lang.Object
protocols.apps.canvas.CanvasPayload
The canvas's "application protocol" that rides inside the gossip
broadcast's opaque
byte[] payload. The dissemination layer doesn't
know or care what these bytes mean — that's the point of layering: gossip
moves bytes; the canvas decides they are a PaintOp.
One paint operation travels per broadcast. We hand-roll the encoding with
DataOutputStream (delegating to PaintOp.writeTo(java.io.DataOutputStream)) so the wire
format is obvious and matches the snapshot encoding used for sync.
-
Method Summary
-
Method Details
-
encode
Serialize a paint op to the bytes carried inside a broadcast message. -
decode
Parse the bytes delivered by the gossip layer back into a paint op.
-