Smack

org.jivesoftware.smackx.bytestreams.ibb.packet
Class DataPacketExtension

java.lang.Object
  extended by org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension
All Implemented Interfaces:
PacketExtension

public class DataPacketExtension
extends java.lang.Object
implements PacketExtension

Represents a chunk of data of an In-Band Bytestream within an IQ stanza or a message stanza

Author:
Henning Staib

Field Summary
static java.lang.String ELEMENT_NAME
          The element name of the data packet extension.
 
Constructor Summary
DataPacketExtension(java.lang.String sessionID, long seq, java.lang.String data)
          Creates a new In-Band Bytestream data packet.
 
Method Summary
 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()
          Returns the root element name.
 java.lang.String getNamespace()
          Returns the root element XML namespace.
 long getSeq()
          Returns the sequence of this packet in regard to the other data packets.
 java.lang.String getSessionID()
          Returns the unique session ID identifying this In-Band Bytestream.
 java.lang.String toXML()
          Returns the XML representation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
The element name of the data packet extension.

See Also:
Constant Field Values
Constructor Detail

DataPacketExtension

public DataPacketExtension(java.lang.String sessionID,
                           long seq,
                           java.lang.String data)
Creates a new In-Band Bytestream data packet.

Parameters:
sessionID - unique session ID identifying this In-Band Bytestream
seq - sequence of this packet in regard to the other data packets
data - 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 long getSeq()
Returns the sequence of this packet in regard to the other data packets.

Returns:
the sequence of this packet 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()
Description copied from interface: PacketExtension
Returns the root element name.

Specified by:
getElementName in interface PacketExtension
Returns:
the element name.

getNamespace

public java.lang.String getNamespace()
Description copied from interface: PacketExtension
Returns the root element XML namespace.

Specified by:
getNamespace in interface PacketExtension
Returns:
the namespace.

toXML

public java.lang.String toXML()
Description copied from interface: PacketExtension
Returns the XML representation of the PacketExtension.

Specified by:
toXML in interface PacketExtension
Returns:
the packet extension as XML.

Smack

Copyright © 2003-2007 Jive Software.