T
- the very type of SourceStream to be adapted by a
BufferStreamAdapterpublic abstract class BufferStreamAdapter<T extends javax.media.protocol.SourceStream>
extends java.lang.Object
implements javax.media.protocol.SourceStream
Modifier and Type | Field and Description |
---|---|
protected T |
stream
The SourceStream being adapted by this instance.
|
Constructor and Description |
---|
BufferStreamAdapter(T stream,
javax.media.Format format)
Initializes a new BufferStreamAdapter which is to adapt a
specific SourceStream into a SourceStream with
a specific Format.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
doRead(javax.media.Buffer buffer,
byte[] data,
int offset,
int length)
Reads byte data from this stream into a specific array of bytes
starting the storing at a specific offset and reading at most a specific
number of bytes.
|
boolean |
endOfStream()
Implements SourceStream#endOfStream().
|
javax.media.protocol.ContentDescriptor |
getContentDescriptor()
Implements SourceStream#getContentDescriptor().
|
long |
getContentLength()
Implements SourceStream#getContentLength().
|
java.lang.Object |
getControl(java.lang.String controlType)
Implements Controls#getControl(String).
|
java.lang.Object[] |
getControls()
Implements Controls#getControls().
|
javax.media.Format |
getFormat()
Gets the Format of the data this stream provides.
|
T |
getStream()
Gets the SourceStream wrapped by this instance.
|
protected void |
read(javax.media.Buffer buffer,
byte[] data,
int offset,
int length)
Reads byte data from this stream into a specific Buffer
which is to use a specific array of bytes for its data.
|
protected final T extends javax.media.protocol.SourceStream stream
public BufferStreamAdapter(T stream, javax.media.Format format)
stream
- the SourceStream to be adaptedformat
- the specific Format of the SourceStreampublic boolean endOfStream()
endOfStream
in interface javax.media.protocol.SourceStream
public javax.media.protocol.ContentDescriptor getContentDescriptor()
getContentDescriptor
in interface javax.media.protocol.SourceStream
public long getContentLength()
getContentLength
in interface javax.media.protocol.SourceStream
public java.lang.Object getControl(java.lang.String controlType)
getControl
in interface javax.media.Controls
controlType
- a String value naming the type of the control
of this instance to be retrievedpublic java.lang.Object[] getControls()
getControls
in interface javax.media.Controls
public javax.media.Format getFormat()
public T getStream()
protected void read(javax.media.Buffer buffer, byte[] data, int offset, int length) throws java.io.IOException
buffer
- the Buffer to read byte data into from this
instancedata
- the array of bytes to read data into from this
instance and to be set as the data of the specified bufferjava.io.IOException
- if I/O related errors occurred during read operationprotected abstract int doRead(javax.media.Buffer buffer, byte[] data, int offset, int length) throws java.io.IOException
buffer
- an optional Buffer instance associated with the
specified data, offset and length and
provided to the method in case the implementation would like to provide
additional Buffer properties such as flagsdata
- the array of bytes into which the data read from
this stream is to be writtenoffset
- the offset in the specified data at which
writing data read from this stream should startlength
- the maximum number of bytes to be written into the
specified datajava.io.IOException
- if I/O related errors occurred during read operation
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.