|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cnrg.itx.datax.devices.StreamSource
Class implementing a stream source. This class will take any InputStream and
synchronize it to make it a valid Source
.
Field Summary | |
private int |
bufferSize
How many buffers should the transfer thread keep? |
private int |
bytesWritten
Attribute for storing the number of bytes written by this source. |
private Channel |
channel
Attribute for storing the Channel reference. |
static int |
DEFAULT_BUFFER_TIME
Default buffer time |
private int |
iDevice
Attribute for storing the device ID. |
private java.io.InputStream |
inputStream
Attribute to store the input stream represented by this source. |
private static int |
instances
Attribute for storing the device instance number. |
private boolean |
mute
Mute state |
private int |
numBuffered
How many samples are currently buffered? |
static int |
SAMPLE_SIZE
File sample size |
private boolean |
start
Thread start/stop flags |
private long |
startTime
Record of last call to System.currentTimeMillis() |
private Stats |
streamStats
Attribute for storing the stream statistics. |
private java.lang.Thread |
thread
Attribute to store the thread object. |
private long |
waitTime
How long should the transfer thread wait between writes? |
Constructor Summary | |
StreamSource(java.io.InputStream inputStream,
Channel channel)
Constructor to make a StreamSource from any input stream (no flow control) |
|
StreamSource(java.io.InputStream inputStream,
Channel channel,
long bufferTime)
Constructor to make a StreamSource from any input stream (flow control) |
Method Summary | |
void |
close()
Method to close the input stream. |
PropertiesCollection |
getProperties()
Returns a collection of properties supported. |
Stats |
getStatistics()
Method to get the statistics of the input stream. |
boolean |
mute(boolean mute)
Method to mute the input stream. |
void |
run()
Method which acts as a thread and pushes data to the channel. |
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 |
start()
Method to start the source thread. |
void |
stop()
Method to stop the thread. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private boolean start
private java.io.InputStream inputStream
private Stats streamStats
private Channel channel
private static int instances
private int iDevice
private int bytesWritten
private java.lang.Thread thread
private long waitTime
private int bufferSize
private int numBuffered
private long startTime
private boolean mute
public static final int SAMPLE_SIZE
public static final int DEFAULT_BUFFER_TIME
Constructor Detail |
public StreamSource(java.io.InputStream inputStream, Channel channel)
inputStream
- The input Streamchannel
- The audio channelpublic StreamSource(java.io.InputStream inputStream, Channel channel, long bufferTime)
inputStream
- The input Streamchannel
- The audio channelbufferTime
- The amount of data to keep buffered on the output stream in msMethod Detail |
public void close()
public boolean mute(boolean mute)
mute
- true to mute and false to resume the streampublic Stats getStatistics()
public void start()
public void run()
public void stop()
public PropertiesCollection getProperties() throws DataException
public void setProperties(PropertiesCollection pc) throws DataException
public void setPeerProperties(PropertiesCollection pc) throws DataException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |