com.sun.media.jsdt
Interface ByteArray
- public abstract interface ByteArray
- extends Manageable
The Byte Array interface. A ByteArray contains an array of bytes that
is shared between all Clients that are currently joined to it.
- Since:
- JSDT 1.0
- Version:
- 1.5 - 7th January 1999
- Author:
- Rich Burridge
Fields inherited from class java.io.Serializable |
serialVersionUID |
Method Summary |
void |
addByteArrayListener(ByteArrayListener listener)
add the specified ByteArray listener to receive ByteArray events for
this ByteArray. |
byte[] |
getValue()
Deprecated. There are now three different methods that can be used to
return the current value contained in a ByteArray 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 getValueAsBytes()
method. |
byte[] |
getValueAsBytes()
get the current value for this shared ByteArray, as an array of bytes. |
java.lang.Object |
getValueAsObject()
get the current value for this shared ByteArray, as a Java object. |
java.lang.String |
getValueAsString()
get the current value for this shared ByteArray, as a String object. |
void |
removeByteArrayListener(ByteArrayListener listener)
removes the specified ByteArray listener so that it no longer receives
ByteArray events for this ByteArray. |
void |
setValue(Client client,
byte[] value)
sets a new value for this shared ByteArray using the given byte array value. |
void |
setValue(Client client,
byte[] value,
int offset,
int length)
sets a new value for this shared ByteArray using a subset of the given
ByteArray. |
void |
setValue(Client client,
java.lang.Object object)
sets a new value for this shared ByteArray using the given Java object. |
void |
setValue(Client client,
java.lang.String string)
sets a new value for this shared ByteArray using the given String. |
Methods inherited from interface com.sun.media.jsdt.Manageable |
destroy,
disableListenerEvents,
disableManagerEvents,
enableListenerEvents,
enableManagerEvents,
expel,
getName,
getSession,
invite,
isManaged,
join,
leave,
listClientNames |
getValue
public byte[] getValue()
throws NoSuchByteArrayException
- Deprecated. There are now three different methods that can be used to
return the current value contained in a ByteArray 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
getValueAsBytes()
method.-
get the current value for this shared ByteArray.
- Returns:
- the byte array containing this ByteArray's current value.
- Throws:
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
getValueAsBytes
public byte[] getValueAsBytes()
throws NoSuchByteArrayException
-
get the current value for this shared ByteArray, as an array of bytes.
- Returns:
- the current value of this ByteArray object, as an array of bytes.
- Throws:
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- Since:
- JSDT 1.5
getValueAsObject
public java.lang.Object getValueAsObject()
throws java.lang.ClassNotFoundException,
NoSuchByteArrayException,
java.io.StreamCorruptedException
-
get the current value for this shared ByteArray, as a Java object.
- Returns:
- the current value of this ByteArray object, as a Java object.
- Throws:
- java.lang.ClassNotFoundException - if the class for this object cannot
be found.
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- java.io.StreamCorruptedException - if this ByteArray object does not
contain a serialized object.
- Since:
- JSDT 1.5
getValueAsString
public java.lang.String getValueAsString()
throws NoSuchByteArrayException
-
get the current value for this shared ByteArray, as a String object.
- Returns:
- the current value of this ByteArray object, as a String object.
- Throws:
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- Since:
- JSDT 1.5
setValue
public void setValue(Client client,
byte[] value)
throws ConnectionException,
InvalidClientException,
NoSuchByteArrayException,
NoSuchClientException,
NoSuchSessionException,
PermissionDeniedException,
TimedOutException
-
sets a new value for this shared ByteArray using the given byte array value.
The new value is sent to all other instances of this shared ByteArray. All
ByteArray listeners will have their
byteArrayValueChanged
method invoked.
- Parameters:
client
- the Client wishing to set the value of this ByteArray.value
- the new byte array value for this shared ByteArray.- Throws:
- ConnectionException - if a connection error occured.
- InvalidClientException - if the Client is invalid is some way (ie.
its getName() method returns null).
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- NoSuchClientException - if this Client doesn't exist.
- NoSuchSessionException - if this Session doesn't exist.
- PermissionDeniedException - if this Client does not have permission
to change the value of this ByteArray.
- TimedOutException - if no reply was received for this operation
in the given timeout period.
setValue
public void setValue(Client client,
byte[] value,
int offset,
int length)
throws ConnectionException,
InvalidClientException,
NoSuchByteArrayException,
NoSuchClientException,
NoSuchSessionException,
PermissionDeniedException,
TimedOutException
-
sets a new value for this shared ByteArray using a subset of the given
ByteArray. The new value is sent to all other instances of this shared
ByteArray. All ByteArray listeners will have their
byteArrayValueChanged
method invoked.
- Parameters:
client
- the Client wishing to set the value of this ByteArray.value
- the byte array that is the source of the new shared
ByteArray value.offset
- the initial offset within the byte array.length
- the number of bytes to use.- Throws:
- ConnectionException - if a connection error occured.
- InvalidClientException - if the Client is invalid is some way (ie.
its getName() method returns null).
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- NoSuchClientException - if this Client doesn't exist.
- NoSuchSessionException - if this Session doesn't exist.
- PermissionDeniedException - if this Client does not have
permission to perform this operation.
- TimedOutException - if no reply was received for this operation
in the given timeout period.
setValue
public void setValue(Client client,
java.lang.String string)
throws ConnectionException,
InvalidClientException,
NoSuchByteArrayException,
NoSuchClientException,
NoSuchSessionException,
PermissionDeniedException,
TimedOutException
-
sets a new value for this shared ByteArray using the given String.
The new value is sent to all other instances of this shared ByteArray.
All ByteArray listeners will have their
byteArrayValueChanged
method invoked.
- Parameters:
client
- the Client wishing to set the value of this ByteArray.value
- the String value from which an array of bytes is set.- Throws:
- ConnectionException - if a connection error occured.
- InvalidClientException - if the Client is invalid is some way (ie.
its getName() method returns null).
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- NoSuchClientException - if this Client doesn't exist.
- NoSuchSessionException - if this Session doesn't exist.
- PermissionDeniedException - if this Client does not have permission
to change the value of this ByteArray.
- TimedOutException - if no reply was received for this operation
in the given timeout period.
- Since:
- JSDT 1.5
setValue
public void setValue(Client client,
java.lang.Object object)
throws ConnectionException,
InvalidClientException,
NoSuchByteArrayException,
NoSuchClientException,
NoSuchSessionException,
PermissionDeniedException,
TimedOutException
-
sets a new value for this shared ByteArray using the given Java object.
The new value is sent to all other instances of this shared ByteArray.
All ByteArray listeners will have their
byteArrayValueChanged
method invoked.
- Parameters:
client
- the Client wishing to set the value of this ByteArray.value
- the Java object value which is serialized into an
array of bytes.- Throws:
- ConnectionException - if a connection error occured.
- InvalidClientException - if the Client is invalid is some way (ie.
its getName() method returns null).
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- NoSuchClientException - if this Client doesn't exist.
- NoSuchSessionException - if this Session doesn't exist.
- PermissionDeniedException - if this Client does not have permission
to change the value of this ByteArray.
- TimedOutException - if no reply was received for this operation
in the given timeout period.
- Since:
- JSDT 1.5
addByteArrayListener
public void addByteArrayListener(ByteArrayListener listener)
throws ConnectionException,
NoSuchByteArrayException,
NoSuchSessionException,
TimedOutException
-
add the specified ByteArray listener to receive ByteArray events for
this ByteArray.
- Parameters:
listener
- the ByteArray listener.- Throws:
- ConnectionException - if a connection error occured.
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- NoSuchSessionException - if this Session doesn't exist.
- TimedOutException - if no reply was received for this operation
in the given timeout period.
removeByteArrayListener
public void removeByteArrayListener(ByteArrayListener listener)
throws ConnectionException,
NoSuchByteArrayException,
NoSuchListenerException,
NoSuchSessionException,
TimedOutException
-
removes the specified ByteArray listener so that it no longer receives
ByteArray events for this ByteArray.
- Parameters:
listener
- the ByteArray listener.- Throws:
- ConnectionException - if a connection error occured.
- NoSuchByteArrayException - if this shared ByteArray doesn't exist.
- NoSuchListenerException - if this ByteArrayListener doesn't exist.
- NoSuchSessionException - if this Session doesn't exist.
- TimedOutException - if no reply was received for this operation
in the given timeout period.