Class DataPacketExtension
- java.lang.Object
-
- org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension
-
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element
,org.jivesoftware.smack.packet.ExtensionElement
,org.jivesoftware.smack.packet.NamedElement
,org.jivesoftware.smack.packet.XmlElement
,org.jivesoftware.smack.packet.XmlLangElement
public class DataPacketExtension extends java.lang.Object implements org.jivesoftware.smack.packet.ExtensionElement
Represents a chunk of data of an In-Band Bytestream within an IQ stanza or a message stanza.
-
-
Constructor Summary
Constructors Constructor Description DataPacketExtension(java.lang.String sessionID, int seq, java.lang.String data)
Creates a new In-Band Bytestream data packet.DataPacketExtension(java.lang.String sessionID, org.jivesoftware.smack.datatypes.UInt16 seq, java.lang.String data)
Creates a new In-Band Bytestream data packet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getData()
Returns the data contained in this packet.byte[]
getDecodedData()
Returns the decoded data or null if data could not be decoded.java.lang.String
getElementName()
protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder
getIQChildElementBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder xml)
java.lang.String
getNamespace()
org.jivesoftware.smack.datatypes.UInt16
getSeq()
Returns the sequence of this stanza in regard to the other data packets.java.lang.String
getSessionID()
Returns the unique session ID identifying this In-Band Bytestream.org.jivesoftware.smack.util.XmlStringBuilder
toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
The element name of the data stanza extension.- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
The XMPP namespace of the In-Band Bytestream.- See Also:
- Constant Field Values
-
QNAME
public static final javax.xml.namespace.QName QNAME
-
-
Constructor Detail
-
DataPacketExtension
public DataPacketExtension(java.lang.String sessionID, int seq, java.lang.String data)
Creates a new In-Band Bytestream data packet.- Parameters:
sessionID
- unique session ID identifying this In-Band Bytestreamseq
- sequence of this stanza in regard to the other data packetsdata
- the base64 encoded data contained in this packet- Throws:
java.lang.IllegalArgumentException
- if seq is not within the range [0, 65535].
-
DataPacketExtension
public DataPacketExtension(java.lang.String sessionID, org.jivesoftware.smack.datatypes.UInt16 seq, java.lang.String data)
Creates a new In-Band Bytestream data packet.- Parameters:
sessionID
- unique session ID identifying this In-Band Bytestreamseq
- sequence of this stanza in regard to the other data packetsdata
- the base64 encoded data contained in this packet
-
-
Method Detail
-
getSessionID
public java.lang.String getSessionID()
Returns the unique session ID identifying this In-Band Bytestream.- Returns:
- the unique session ID identifying this In-Band Bytestream
-
getSeq
public org.jivesoftware.smack.datatypes.UInt16 getSeq()
Returns the sequence of this stanza in regard to the other data packets.- Returns:
- the sequence of this stanza in regard to the other data packets.
-
getData
public java.lang.String getData()
Returns the data contained in this packet.- Returns:
- the data contained in this packet.
-
getDecodedData
public byte[] getDecodedData()
Returns the decoded data or null if data could not be decoded.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.
- Returns:
- the decoded data
-
getElementName
public java.lang.String getElementName()
- Specified by:
getElementName
in interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespace
in interfaceorg.jivesoftware.smack.packet.XmlElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
- Specified by:
toXML
in interfaceorg.jivesoftware.smack.packet.Element
-
getIQChildElementBuilder
protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder xml)
-
-