Package org.microproxy.quic
Class QuicDatagram
java.lang.Object
org.microproxy.quic.QuicDatagram
One datagram's payload (RFC 9221) of an intercepted QUIC connection, as a
QuicInterceptor
sees it.-
Constructor Summary
ConstructorsConstructorDescriptionQuicDatagram(byte[] data, boolean fromClient, Instant timestamp) A datagram. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()The payload as received.booleanReturns whether the client sent the datagram (going to the server), rather than the server.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 datagram with another payload, the same direction and timestamp.
-
Constructor Details
-
QuicDatagram
A datagram.- Parameters:
data- the payload, which the datagram holds as it is (not copied)fromClient- whether the client sent it, rather than the servertimestamp- when the proxy received it
-
-
Method Details
-
data
public byte[] data()The payload as received. The array is the datagram'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 server), rather than the server.- Returns:
- whether the client sent the datagram (going to the server), rather than the server
-
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 datagram with another payload, the same direction and timestamp.- Parameters:
data- the payload of the copy (not copied)- Returns:
- the copy
-
toString
-