cnrg.itx.datax.devices
Class StreamDestination

java.lang.Object
  |
  +--cnrg.itx.datax.devices.StreamDestination

public class StreamDestination
extends java.lang.Object
implements Destination

Class to define a stream of data. Any valid output stream can be represented by this class as a valid Destination object.


Constructor Summary
StreamDestination(java.io.OutputStream outStream)
          Constructor to create a stream destination.
 
Method Summary
 void close()
          Method to close the stream
 PropertiesCollection getProperties()
          Returns a collection of properties supported.
 Stats getStatistics()
          Method to get the statistics of the output stream.
 boolean mute(boolean mute)
          Method to mute the stream.
 void setPeerProperties(PropertiesCollection pc)
          Interface to set the given properties collection into the device.
 void setProperties(PropertiesCollection pc)
          Sets the given properties collection into the device
 void write(byte[] b)
          Method to write data to the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamDestination

public StreamDestination(java.io.OutputStream outStream)
                  throws DataException
Constructor to create a stream destination.
Parameters:
OutputStream - The output stream for this destination
Throws:
DataException - This is thrown in case of IO errors
Method Detail

write

public void write(byte[] b)
           throws DataException
Method to write data to the stream.
Specified by:
write in interface Destination
Parameters:
b - The array of bytes to write to the stream
Throws:
DataException - This is thrown when an IO error occurs

close

public void close()
Method to close the stream
Specified by:
close in interface Destination

mute

public boolean mute(boolean mute)
Method to mute the stream. This method is a no op as there is nothing to mute in an output stream.
Specified by:
mute in interface Destination
Parameters:
mute - The mode of the mute
Returns:
boolean The mute state of the stream

getStatistics

public Stats getStatistics()
Method to get the statistics of the output stream.
Returns:
Stats The statistics of the output stream

getProperties

public PropertiesCollection getProperties()
                                   throws DataException
Returns a collection of properties supported.

setProperties

public void setProperties(PropertiesCollection pc)
                   throws DataException
Sets the given properties collection into the device

setPeerProperties

public void setPeerProperties(PropertiesCollection pc)
                       throws DataException
Interface to set the given properties collection into the device. WOrks under the assumption that this is the properties collection of the peer.