Package org.microproxy.udp
Class UdpMessage
java.lang.Object
org.microproxy.udp.UdpMessage
One datagram's payload in a UDP flow the proxy relays, as a
UdpInterceptor sees it.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()The payload as received.booleanReturns whether the client sent the datagram (going to the target), rather than the target.intlength()Returns the number of bytes.text()The payload decoded as UTF-8, malformed sequences replaced with U+FFFD.Returns when the proxy received the datagram.toString()withData(byte[] data) A copy of this message with another payload, the same direction and timestamp.
-
Constructor Details
-
UdpMessage
A message.- Parameters:
data- the payload, which the message holds as it is (not copied)fromClient- whether the client sent it, rather than the targettimestamp- when the proxy received it
-
-
Method Details
-
data
public byte[] data()The payload as received. The array is the message's own, not a copy: an interceptor may change it in place and return it.- Returns:
- the payload
-
length
public int length()Returns the number of bytes.- Returns:
- the number of bytes
-
fromClient
public boolean fromClient()Returns whether the client sent the datagram (going to the target), rather than the target.- Returns:
- whether the client sent the datagram (going to the target), rather than the target
-
timestamp
Returns when the proxy received the datagram.- Returns:
- when the proxy received the datagram
-
text
The payload decoded as UTF-8, malformed sequences replaced with U+FFFD.- Returns:
- the text
-
withData
A copy of this message with another payload, the same direction and timestamp.- Parameters:
data- the payload of the copy (not copied)- Returns:
- the copy
-
toString
-