0

I'm trying to simulate a virtual IP datagram to send through DatagramPacket, which accepts byte array only. However, many headers in IP datagram are 16-bit long. What I'm trying to do is to divide it into 2 8-bit number, but the byte in Java is -127 to 127, what I want is 0 - 256. Is there any way to achieve it?

Chloe Sun
  • 23
  • 5

0 Answers0