Class DataPacketExtension
- java.lang.Object
-
- org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension
-
- All Implemented Interfaces:
Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public class DataPacketExtension extends Object implements 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(String sessionID, int seq, String data)
Creates a new In-Band Bytestream data packet.DataPacketExtension(String sessionID, UInt16 seq, String data)
Creates a new In-Band Bytestream data packet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.protected IQ.IQChildElementXmlStringBuilder
getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder xml)
String
getNamespace()
Returns the root element XML namespace.UInt16
getSeq()
Returns the sequence of this stanza in regard to the other data packets.String
getSessionID()
Returns the unique session ID identifying this In-Band Bytestream.XmlStringBuilder
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final String ELEMENT
The element name of the data stanza extension.- See Also:
- Constant Field Values
-
NAMESPACE
public static final String NAMESPACE
The XMPP namespace of the In-Band Bytestream.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DataPacketExtension
public DataPacketExtension(String sessionID, int seq, 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:
IllegalArgumentException
- if seq is not within the range [0, 65535].
-
DataPacketExtension
public DataPacketExtension(String sessionID, UInt16 seq, 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 String getSessionID()
Returns the unique session ID identifying this In-Band Bytestream.- Returns:
- the unique session ID identifying this In-Band Bytestream
-
getSeq
public 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 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 String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
getIQChildElementBuilder
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder xml)
-
-