title: Translate Python into Java
body: <p>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:</p>
  
  <p><code>packet = (b'\x0C\x15\x33\x00' + os.urandom(4) + (b'\x00' * 38) + struct.pack('&lt;H', len(enccmd)) + enccmd).ljust(512, b'\x00')</code></p>
  
  <p>enccmd is a string containing a command that was encoded previously/</p>
  
  <p>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.</p>
  
  <p>Can anyone help?</p>