code: public synchronized void setData(byte[] buf) {
          if (buf == null) {
              throw new NullPointerException("null packet buffer");
          }
          this.buf = buf;
          this.offset = 0;
          this.length = buf.length;
          this.bufLength = buf.length;
      }
docs: Set the data buffer for this packet. With the offset of
  this DatagramPacket set to 0, and the length set to
  the length of <code>buf</code>.
  
  @param buf the buffer to set for this packet.
  
  @exception NullPointerException if the argument is null.
  
  @see #getLength
  @see #getData
  
  @since JDK1.1