public class DataPacketExtension extends Object implements PacketExtension
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT_NAME
The element name of the data packet extension.
|
Constructor and Description |
---|
DataPacketExtension(String sessionID,
long seq,
String data)
Creates a new In-Band Bytestream data packet.
|
Modifier and Type | Method and Description |
---|---|
String |
getData()
Returns the data contained in this packet.
|
byte[] |
getDecodedData()
Returns the decoded data or null if data could not be decoded.
|
String |
getElementName()
Returns the root element name.
|
String |
getNamespace()
Returns the root element XML namespace.
|
long |
getSeq()
Returns the sequence of this packet in regard to the other data packets.
|
String |
getSessionID()
Returns the unique session ID identifying this In-Band Bytestream.
|
String |
toXML()
Returns the XML representation of the PacketExtension.
|
public static final String ELEMENT_NAME
public DataPacketExtension(String sessionID, long seq, String data)
sessionID
- unique session ID identifying this In-Band Bytestreamseq
- sequence of this packet in regard to the other data packetsdata
- the base64 encoded data contained in this packetpublic String getSessionID()
public long getSeq()
public String getData()
public byte[] getDecodedData()
The encoded data is invalid if it contains bad Base64 input characters or if it contains the pad ('=') character on a position other than the last character(s) of the data. See XEP-0047 Section 6.
public String getElementName()
PacketExtension
getElementName
in interface PacketExtension
public String getNamespace()
PacketExtension
getNamespace
in interface PacketExtension
public String toXML()
PacketExtension
toXML
in interface PacketExtension