39 * Unless otherwise specified, passing a {@code null} argument causes
40 * a {@link NullPointerException NullPointerException} to be thrown.
41 *
42 * <p>
43 * Methods and constructors of {@code DatagramPacket} accept parameters
44 * of type {@link SocketAddress}. {@code DatagramPacket} supports
45 * {@link InetSocketAddress}, and may support additional {@code SocketAddress}
46 * sub-types.
47 *
48 * @author Pavani Diwanji
49 * @author Benjamin Renaud
50 * @since 1.0
51 */
52 public final
53 class DatagramPacket {
54
55 /**
56 * Perform class initialization
57 */
58 static {
59 jdk.internal.loader.BootLoader.loadLibrary("net");
60 init();
61 }
62
63 /*
64 * The fields of this class are package-private since DatagramSocketImpl
65 * classes needs to access them.
66 */
67 byte[] buf;
68 int offset;
69 int length;
70 int bufLength;
71 InetAddress address;
72 int port;
73
74 /**
75 * Constructs a {@code DatagramPacket} for receiving packets of
76 * length {@code length}, specifying an offset into the buffer.
77 * <p>
78 * The {@code length} argument must be less than or equal to
79 * {@code buf.length}.
|
39 * Unless otherwise specified, passing a {@code null} argument causes
40 * a {@link NullPointerException NullPointerException} to be thrown.
41 *
42 * <p>
43 * Methods and constructors of {@code DatagramPacket} accept parameters
44 * of type {@link SocketAddress}. {@code DatagramPacket} supports
45 * {@link InetSocketAddress}, and may support additional {@code SocketAddress}
46 * sub-types.
47 *
48 * @author Pavani Diwanji
49 * @author Benjamin Renaud
50 * @since 1.0
51 */
52 public final
53 class DatagramPacket {
54
55 /**
56 * Perform class initialization
57 */
58 static {
59 sun.security.action.LoadLibraryAction.privilegedLoadLibrary("net");
60 init();
61 }
62
63 /*
64 * The fields of this class are package-private since DatagramSocketImpl
65 * classes needs to access them.
66 */
67 byte[] buf;
68 int offset;
69 int length;
70 int bufLength;
71 InetAddress address;
72 int port;
73
74 /**
75 * Constructs a {@code DatagramPacket} for receiving packets of
76 * length {@code length}, specifying an offset into the buffer.
77 * <p>
78 * The {@code length} argument must be less than or equal to
79 * {@code buf.length}.
|