|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.protocol.BufferStreamAdapter<T>
T - the very type of SourceStream to be adapted by a
BufferStreamAdapterpublic abstract class BufferStreamAdapter<T extends javax.media.protocol.SourceStream>
Represents a base class for adapters of SourceStreams, usually ones reading data in arrays of bytes and not in Buffers, to SourceStreams reading data in Buffers. An example use is creating a PushBufferStream representation of a PushSourceStream.
| Field Summary | |
|---|---|
protected T |
stream
The SourceStream being adapted by this instance. |
| Fields inherited from interface javax.media.protocol.SourceStream |
|---|
LENGTH_UNKNOWN |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
boolean |
endOfStream()
Implements SourceStream#endOfStream(). |
javax.media.protocol.ContentDescriptor |
getContentDescriptor()
Implements SourceStream#getContentDescriptor(). |
long |
getContentLength()
Implements SourceStream#getContentLength(). |
Object |
getControl(String controlType)
Implements Controls#getControl(String). |
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[] bytes)
Reads byte data from this stream into a specific Buffer which is to use a specific array of bytes for its data. |
protected abstract int |
read(byte[] buffer,
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final T extends javax.media.protocol.SourceStream stream
| Constructor Detail |
|---|
public BufferStreamAdapter(T stream,
javax.media.Format format)
stream - the SourceStream to be adaptedformat - the specific Format of the SourceStream| Method Detail |
|---|
public boolean endOfStream()
endOfStream in interface javax.media.protocol.SourceStreampublic javax.media.protocol.ContentDescriptor getContentDescriptor()
getContentDescriptor in interface javax.media.protocol.SourceStreampublic long getContentLength()
getContentLength in interface javax.media.protocol.SourceStreampublic Object getControl(String controlType)
getControl in interface javax.media.ControlscontrolType - a String value naming the type of the control
of this instance to be retrieved
public Object[] getControls()
getControls in interface javax.media.Controlspublic javax.media.Format getFormat()
public T getStream()
protected void read(javax.media.Buffer buffer,
byte[] bytes)
throws IOException
buffer - the Buffer to read byte data into from this
instancebytes - the array of bytes to read data into from this
instance and to be set as the data of the specified
buffer
IOException - if I/O related errors occurred during read operation
protected abstract int read(byte[] buffer,
int offset,
int length)
throws IOException
buffer - the array of bytes into which the data read
from this stream is to be writtenoffset - the offset in the specified buffer at which
writing data read from this stream should startlength - the maximum number of bytes to be written into the
specified buffer
IOException - if I/O related errors occurred during read operation
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||