/** * 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). */ 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). */ 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). */ 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). */ 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). */ 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). */ 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). */ 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); }