title: getOffset() of a packet returns 0 on the receiver's end
body: <p>I have a lengthy text file that I am trying to transport across UDP on localhost so naturally I have to break up the byte buffer to send the file in packets.</p>
  
  <p>The problem I'm having is this:</p>
  
  <p>On the server side, I send a packet of data with the offset into the byte buffer set to say 500:</p>
  
  <pre><code>        byte[] buf = text.getBytes();
          InetAddress address = InetAddress.getByName("localhost");
  
          DatagramPacket packet = new DatagramPacket(buf, 500, BYTES_PER_PACKET, address, udp_port_num);
  
          System.out.println("Offset at server:  " + packet.getOffset());
          udpSocket.send(packet);
  </code></pre>
  
  <p>The print statement returns the expected answer of 500.</p>
  
  <p>But then on the client side:</p>
  
  <pre><code>                byte[] buf = new byte[BYTES_PER_PACKET];                    
                  DatagramPacket packet = new DatagramPacket(buf, BYTES_PER_PACKET);
  
                  udpSocket.receive(packet);
  
                  String received = new String(packet.getData());
  
                  System.out.println(received);
                  System.out.println("Offset:  " + packet.getOffset());
  </code></pre>
  
  <p>It prints the correct text from the offset of the file in received, but packet.getOffset() always returns 0.  Why isn't it returning the same 500 from the server and/or how can I get it to return the same 500 from the server?</p>
  
  <p>Thanks in advance</p>