public interface PushSourceStream2 extends PushSourceStream
PushSourceStream2 interface identifies a
SourceStream that pushes asynchronous data.
Note that a PushSourceStream2 provides no
guarantees of the length of time that incoming data will be
buffered before being discarded or overwritten with new data.
Because of the time-dependent nature of the stream, clients should
read the pending data immediately upon notification.
This interface is functionally identical to
javax.media.protocol.PushSourceStream, except that it
provides the readStream() method that throws
exceptions. Instances of PushSourceStream2 may be
obtained through the JMF method
javax.media.protocol.PushDataSource.getStreams(). In
Java TV implementations, objects returned by this method will be of
type PushSourceStream2. Instances of
PushDataSource are obtained by means of
javax.media.Manager.createDataSource(javax.media.MediaLocator).
If access to broadcast asynchronous data is not supported by the
system, this method will throw
javax.media.NoDataSourceException.
javax.media.protocol.PushDataSource.getStreams()LENGTH_UNKNOWN| Modifier and Type | Method and Description |
|---|---|
int |
readStream(byte[] buffer,
int offset,
int length)
Reads pending data from the stream without blocking.
|
getMinimumTransferSize, read, setTransferHandlerendOfStream, getContentDescriptor, getContentLengthgetControl, getControlsint readStream(byte[] buffer,
int offset,
int length)
throws IOException,
DataLostException
buffer - The buffer to read bytes into.offset - The offset into the buffer at which to begin writing
data.length - The number of bytes to read.IOException - If an I/O error occurs.DataLostException - If data from the stream has been lost.ArrayIndexOutOfBoundsException - If offset <
0, length < 0, or offset+length >
buffer.length.Copyright © 2012 code4tv.com. All Rights Reserved.