The second important detail is that all data on the network is in network byte-order (big-endian)5.1. So, before sending a message to the server, the client must ensure that all multibyte fields (i.e., shorts and ints) are in network byte-order. Analogously, before interpreting any messages from the server, the client must ensure that all multibyte fields are in the native byte-order. Single characters require no special processing.
Most programming languages provide some method for converting from network to native byte-order and back. For example, in C you can use library functions like ntohs() and htons(). On the other hand, Java handles byteswapping on data streams automatically, and Tcl offers a choice of byte-order when using the binary command to marshal and demarshal binary strings.