Alexander Ciesielski
Alexander Ciesielski

Reputation: 10834

What endianness has received packet in Java?

I am working on a little UDP Java Server, which receives UDP Datagram Packets from a device that sends some kind of status messages. All multibyte numbers (e.g. field LEN: 3 bytes) are sent in little-endian.

Since Java only works on big-endian, my question is the following: Are these numbers automatically converted to big-endian upon receival?

Upvotes: 1

Views: 369

Answers (1)

user207421
user207421

Reputation: 310875

What endianness has received packet in Java?

It has whatever the sender put in it.

Are these numbers automatically converted to big-endian upon receival?

Java doesn't change anything.

Upvotes: 1

Related Questions