Rocinante – encoding and decoding

The third article on Rocinante finally deals with the interesting part of the protocol. How the parts of a message are encoded into the binary Protocol Buffer representation and decoded again. Rocinante uses a two-stage approach. The basis is formed by a ProtoInputStream and a ProtoOutputStream, in which the basic mechanisms are implemented. For each message a generated Proto class with individual read and write methods is based on this.