Reputation: 29
I have a client/server model. They communicate with each other with specific message formats. Each message has several fields, like, request_type(4 bytes), request_parameters(String[]), flag(1 byte). Which is the better way to reassemble the message sent to other side? bytes[] array or an Object which wraps all fields?
Upvotes: 2
Views: 150
Reputation: 634
Sending a object would be better so that you can access fields easily and don't have to analyze fields in bytes[] array.
Upvotes: 1