code: public synchronized void setData(byte[] buf, int offset, int length) {
          /* this will check to see if buf is null */
          if (length < 0 || offset < 0 ||
              (length + offset) < 0 ||
              ((length + offset) > buf.length)) {
              throw new IllegalArgumentException("illegal length or offset");
          }
          this.buf = buf;
          this.length = length;
          this.bufLength = length;
          this.offset = offset;
      }
docs: Set the data buffer for this packet. This sets the
  data, length and offset of the packet.
  
  @param buf the buffer to set for this packet
  
  @param offset the offset into the data
  
  @param length the length of the data
  and/or the length of the buffer used to receive data
  
  @exception NullPointerException if the argument is null
  
  @see #getData
  @see #getOffset
  @see #getLength
  
  @since 1.2