title: Java How to parse raw data from a UDP packet
body: <p>I have hypothetical data coming from a UDP connection that is in binary form.</p>
  
  <p>Its composed of 5 fields, with a size of 25 bits </p>
  
  <p>their offsets as follows</p>
  
  <pre><code> 1. 0-4 ID
   2. 5-10 payload
   3. 11-12 status
   4. 13-23 location
   5. 23-25 checksum
  </code></pre>
  
  <p><strong>How do I read in this data?</strong></p>
  
  <pre><code>        DatagramSocket serverSocket = new DatagramSocket(18000);
          byte[] receiveData = new byte[1024];
  
          while (true)
          {
              DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
              serverSocket.receive(receivePacket);
  
             //not sure how I should be reading the raw binary data back in
  
          }
  </code></pre>
  
  <p><strong>How would I store off this data?</strong></p>