Home » JAVA Programming » Networking » Question
  1. Which of these methods of DatagramPacket is used to find the length of byte array?
    1. Length()
    2. getLength()
    3. getnumber()
    4. length()
    5. None of these
Correct Option: B

getLength returns the length of the valid data contained in the byte array that would be returned from the getData () method. This typically is not equal to length of whole byte array.



Your comments will be displayed only after manual approval.