DthingApi
|
Public Member Functions | |
DatagramPacket (byte[] data, int length) | |
DatagramPacket (byte[] data, int offset, int length) | |
DatagramPacket (byte[] data, int offset, int length, InetAddress host, int aPort) | |
DatagramPacket (byte[] data, int length, InetAddress host, int port) | |
synchronized InetAddress | getAddress () |
synchronized byte [] | getData () |
synchronized int | getLength () |
synchronized int | getOffset () |
synchronized int | getPort () |
synchronized void | setAddress (InetAddress addr) |
synchronized void | setData (byte[] data, int offset, int byteCount) |
synchronized void | setData (byte[] buf) |
synchronized void | setLength (int length) |
synchronized void | setPort (int aPort) |
DatagramPacket (byte[] data, int length, SocketAddress sockAddr) throws SocketException | |
DatagramPacket (byte[] data, int offset, int length, SocketAddress sockAddr) throws SocketException | |
synchronized SocketAddress | getSocketAddress () |
synchronized void | setSocketAddress (SocketAddress sockAddr) |
This class represents a datagram packet which contains data either to be sent or received through a
. It holds additional information such as its source or destination host.
|
inline |
Constructs a new
object to receive data up to
bytes.
data | a byte array to store the read characters. |
length | the length of the data buffer. |
|
inline |
Constructs a new
object to receive data up to
bytes with a specified buffer offset.
data | a byte array to store the read characters. |
offset | the offset of the byte array where the bytes is written. |
length | the length of the data. |
|
inline |
Constructs a new
object to send data to the port
of the address
. The
must be lesser than or equal to the size of
. The first
bytes from the byte array position
are sent.
data | a byte array which stores the characters to be sent. |
offset | the offset of data |
length | the length of data. |
host | the address of the target host. |
aPort | the port of the target host. |
|
inline |
Constructs a new
object to send data to the port
of the address
. The
must be lesser than or equal to the size of
. The first
bytes are sent.
data | a byte array which stores the characters to be sent. |
length | the length of data. |
host | the address of the target host. |
port | the port of the target host. |
|
inline |
Constructs a new
object to send data to the address
. The
must be lesser than or equal to the size of
. The first
bytes of the data are sent.
data | the byte array to store the data. |
length | the length of the data. |
sockAddr | the target host address and port. |
SocketException | if an error in the underlying protocol occurs. |
|
inline |
Constructs a new
object to send data to the address
. The
must be lesser than or equal to the size of
. The first
bytes of the data are sent.
data | the byte array to store the data. |
offset | the offset of the data. |
length | the length of the data. |
sockAddr | the target host address and port. |
SocketException | if an error in the underlying protocol occurs. |
|
inline |
Gets the sender or destination IP address of this datagram packet.
|
inline |
Gets the data of this datagram packet.
|
inline |
Gets the length of the data stored in this datagram packet.
|
inline |
Gets the offset of the data stored in this datagram packet.
|
inline |
Gets the port number of the target or sender host of this datagram packet.
|
inline |
Gets the host address and the port to which this datagram packet is sent as a
object.
|
inline |
Sets the IP address of the target host.
addr | the target host address. |
|
inline |
Sets the data buffer for this datagram packet.
|
inline |
Sets the data buffer for this datagram packet. The length of the datagram packet is set to the buffer length.
buf | the buffer to store the data. |
|
inline |
Sets the length of the datagram packet. This length plus the offset must be lesser than or equal to the buffer size.
length | the length of this datagram packet. |
|
inline |
Sets the port number of the target host of this datagram packet.
aPort | the target host port number. |
|
inline |
Sets the
for this datagram packet.
sockAddr | the SocketAddress of the target host. |