I'm trying to translate a little Python script into Java. It's pretty simple - it sends some data to a UDP port and looks at the result. I'm not a Python guy, and haven't done too much socket programming, but I've figured out the translation of everything except one line:
packet = (b'\x0C\x15\x33\x00' + os.urandom(4) + (b'\x00' * 38) + struct.pack('<H', len(enccmd)) + enccmd).ljust(512, b'\x00')
enccmd is a string containing a command that was encoded previously/
This is building the data packet that's going to be sent. I know that this translates into the creation of a DatagramPacket object, I just don't know how to do it.
Can anyone help?