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 ; }
Set the data buffer for this packet . This sets the data length and offset of the packet .