Parse a DatagramPacket after converting it to a byte array in Java

前端 未结 4 1197
日久生厌
日久生厌 2021-02-04 20:42

I am trying to parse a DatagramPacket that I will receive at a socket. I know the format of the packet I will receive, which is a DHCPREQUEST packet, but I don\'t think that rea

4条回答
  •  执笔经年
    2021-02-04 21:46

    Wrap the byte array in a ByteArrayOutputStream; wrap a DataInputStream around that; then use the methods of DataInputStream.

提交回复
热议问题