public int read(byte[] packet,int offset,int byteCount,int destPort,int timeoutMillis){
  if (packet == null) {
    throw new NullPointerException("packet == null");
  }
  Arrays.checkOffsetAndCount(packet.length,offset,byteCount);
  if (destPort > 65535) {
    throw new IllegalArgumentException("Port out of range: " + destPort);
  }
  return recvPacket(fd,packet,offset,byteCount,destPort,timeoutMillis);
}

public int read ( byte [ ] packet , int offset , int byteCount , int destPort , int timeoutMillis ) { if ( packet == null ) { throw new NullPointerException ( "packet == null" ) ; } Arrays . checkOffsetAndCount ( packet . length , offset , byteCount ) ; if ( destPort > 65535 ) { throw new IllegalArgumentException ( "Port out of range: " + destPort ) ; } return recvPacket ( fd , packet , offset , byteCount , destPort , timeoutMillis ) ; }
reads a raw packet into the specified buffer , with the specified timeout . if the destport is - 1 , then the ip destination port is not verified , otherwise only packets destined for the specified udp port are returned . returns the length actually read . no indication of overflow is signaled . the packet data will start at the ip header ( ethernetii dest / source / type headers are removed ) .
