public final class ApplicationMessage extends AbstractMessage
| Constructor and Description |
|---|
ApplicationMessage(byte[] data,
InetSocketAddress peerAddress)
Creates a new APPLICATION_DATA message containing specific data.
|
| Modifier and Type | Method and Description |
|---|---|
static DTLSMessage |
fromByteArray(byte[] byteArray,
InetSocketAddress peerAddress)
Create message from byte array.
|
ContentType |
getContentType()
Gets the message's content type.
|
byte[] |
getData() |
int |
size()
Gets the number of bytes representing this message as defined
by TLS 1.2, Appendix A.
|
byte[] |
toByteArray()
Gets the byte array representation of this message as defined
by TLS 1.2, Appendix A.
|
String |
toString() |
getPeerpublic ApplicationMessage(byte[] data,
InetSocketAddress peerAddress)
The given byte array will not be cloned/copied, i.e. any changes made to the byte array after this method has been invoked will be exposed in the message's payload.
data - byte array with the application data.peerAddress - the IP address and port the message is to be sent to
or has been received fromNullPointerException - if peer or data is nullpublic ContentType getContentType()
DTLSMessagepublic int size()
DTLSMessagepublic byte[] toByteArray()
DTLSMessagepublic static DTLSMessage fromByteArray(byte[] byteArray, InetSocketAddress peerAddress)
The given byte array will not be cloned/copied, i.e. any changes made to the byte array after this method has been invoked will be exposed in the message's payload.
byteArray - byte array with the application data.peerAddress - peer's addressApplicationMessage(byte[], InetSocketAddress)public byte[] getData()
Copyright © 2023 Eclipse Foundation. All rights reserved.