The protocol uses parity to distinguish between control (even) and data (odd) characters. Obviously data is then limited to 7 bit ASCII.
The Parity trait provides
- apply(b:Byte):Byte return b with 8th (parity) bit set to achieve the specified parity.
- unapply(b:Byte):Boolean returns true iff b has the required parity.
The EvenParity and OddParity objects then implement the trait, providing the appropriate value for the abstract value remainder
The protocol requires a parity byte, computed over a block of bytes. That block is represented by a Seq, so as to provide maximum flexibility.