com.sun.media.jsdt
Class Data

java.lang.Object
  |
  +--com.sun.media.jsdt.impl.JSDTObject
        |
        +--com.sun.media.jsdt.Data

public class Data
extends com.sun.media.jsdt.impl.JSDTObject

The Data class.

Since:
JSDT 1.0
Version:
1.5 - 10th March 1999
Author:
Rich Burridge
See Also:
Serialized Form

Fields inherited from class com.sun.media.jsdt.impl.JSDTObject
giveTime, httpTunnelPort, maxQueueSize, maxThreadPoolSize, pingPeriod, registryAddress, registryPort, registryTime, showMessage, showStack, socketFactoryClass, SSLCipher, timeoutPeriod, TTL, versionString
 
Constructor Summary
Data(byte[] data)
           constructor for the Data class.
Data(byte[] data, int length)
           constructor for the Data class.
Data(java.lang.Object object)
           constructor for the Data class.
Data(java.lang.String string)
           constructor for the Data class.
 
Method Summary
 Channel getChannel()
           get the Channel that this data was sent over.
 byte[] getData()
          Deprecated. There are now three different methods that can be used to return the data contained in a Data object. The naming of this method is inconsistent with those three methods. As of JSDT 1.5, the preferred way to do this is via the getDataAsBytes() method.
 byte[] getDataAsBytes()
           get the data associated with this Data object, as an array of bytes.
 java.lang.Object getDataAsObject()
           get the data associated with this Data object, as a Java Object.
 java.lang.String getDataAsString()
           get the data associated with this Data object, as a String object.
 int getLength()
           get the length of the data in this Data object.
 int getPriority()
           gets the priority that this Data was sent at.
 java.lang.String getSenderName()
           get the name of the Data sender.
 void setChannel(Channel channel)
           set a new channel value for this data.
 void setPriority(int priority)
           set a new priority value for this data.
 void setSenderName(java.lang.String senderName)
           set a new sender name for this data.
 
Methods inherited from class com.sun.media.jsdt.impl.JSDTObject
error, getConnectionType, setConnectionType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data

public Data(byte[] data)
constructor for the Data class. An array of bytes is turned into a Data object. The length of the data array is the length of the data object.
Parameters:
data - the data (an array of bytes).

Data

public Data(byte[] data,
            int length)
constructor for the Data class. An array of bytes is turned into a Data object. The length of the data object is provided. If this value is invalid, then the length of the data object is the length of the array of bytes.
Parameters:
data - the data (an array of bytes).
length - the length of the data.

Data

public Data(java.lang.String string)
constructor for the Data class. A String is turned into a Data object. The length of the data array is the length of the String object.
Parameters:
string - the data (a String).

Data

public Data(java.lang.Object object)
constructor for the Data class. A Java object is turned into a Data object. The length of the data array is the length of the serialized Java object.
Parameters:
object - the data (a Java object).
Since:
JSDT 1.5
Method Detail

getData

public byte[] getData()
Deprecated. There are now three different methods that can be used to return the data contained in a Data object. The naming of this method is inconsistent with those three methods. As of JSDT 1.5, the preferred way to do this is via the getDataAsBytes() method.
get the data associated with this Data object.
Returns:
the data (an array of bytes) contained in this Data object.

getDataAsBytes

public byte[] getDataAsBytes()
get the data associated with this Data object, as an array of bytes.
Returns:
the data contained in this Data object, as an array of bytes.
Since:
JSDT 1.5

getDataAsObject

public java.lang.Object getDataAsObject()
                                 throws java.lang.ClassNotFoundException,
                                        java.io.StreamCorruptedException
get the data associated with this Data object, as a Java Object.
Returns:
the data contained in this Data object, as a Java Object.
Throws:
java.lang.ClassNotFoundException - if the class for this object cannot be found.
java.io.StreamCorruptedException - if this Data object does not contain a serialized object.
Since:
JSDT 1.5

getDataAsString

public java.lang.String getDataAsString()
get the data associated with this Data object, as a String object.
Returns:
the data contained in this Data object, as a String object.
Since:
JSDT 1.5

getLength

public int getLength()
get the length of the data in this Data object.
Returns:
the length (in bytes) of the data in this Data object.

getSenderName

public java.lang.String getSenderName()
get the name of the Data sender.
Returns:
the name of the sender of this Data.

getPriority

public int getPriority()
gets the priority that this Data was sent at.
Returns:
the priority that this Data was sent at.

setPriority

public void setPriority(int priority)
set a new priority value for this data.
Parameters:
priority - the new priority value.

getChannel

public Channel getChannel()
get the Channel that this data was sent over.
Returns:
the Channel that this Data was sent over.

setChannel

public void setChannel(Channel channel)
set a new channel value for this data.
Parameters:
channel - the new channel value.

setSenderName

public void setSenderName(java.lang.String senderName)
set a new sender name for this data.
Parameters:
senderName - the new sender name.