Ting W
Ting W

Reputation: 29

Java SSL socket message transfer, Object or byte[]?

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

Answers (1)

Daolin
Daolin

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

Related Questions