What are the best practices protocol stack development in Java?
In this specific case, my Java app will be "talking" to a PC peripheral, whose bus will transmit data in a protocol format.
Example:
Imagine that my protocol have a message composed by one integer, a String and a list of integers:
class MyMessage { int filed1; String filed2; LinkedList<int> field3;}
What I want as a final product it's something that allows to do that:
// Message to fill
MyMessage msg = new MyMessage();
// InputStream with the data to bind
InputStream stream = myPeripheralBus.getInputSTream();
msg.fill(stream);
// Here, msg fields are filled with the values that were on the InputStream