net.java.sip.communicator.impl.neomedia.protocol
Class PushBufferStreamAdapter
java.lang.Object
net.java.sip.communicator.impl.neomedia.protocol.BufferStreamAdapter<javax.media.protocol.PushSourceStream>
net.java.sip.communicator.impl.neomedia.protocol.PushBufferStreamAdapter
- All Implemented Interfaces:
- javax.media.Controls, javax.media.protocol.PushBufferStream, javax.media.protocol.SourceStream
public class PushBufferStreamAdapter
- extends BufferStreamAdapter<javax.media.protocol.PushSourceStream>
- implements javax.media.protocol.PushBufferStream
Represents a PushBufferStream which reads its data from a
specific PushSourceStream.
- Author:
- Lubomir Marinov
| Fields inherited from interface javax.media.protocol.SourceStream |
LENGTH_UNKNOWN |
|
Constructor Summary |
PushBufferStreamAdapter(javax.media.protocol.PushSourceStream stream,
javax.media.Format format)
Initializes a new PushBufferStreamAdapter instance which
reads its data from a specific PushSourceStream with a
specific Format |
|
Method Summary |
void |
read(javax.media.Buffer buffer)
Implements PushBufferStream#read(Buffer). |
protected int |
read(byte[] buffer,
int offset,
int length)
Implements BufferStreamAdapter#read(byte[], int, int). |
void |
setTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)
Implements PushBufferStream#setTransferHandler(BufferTransferHandler). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.media.protocol.PushBufferStream |
getFormat |
| Methods inherited from interface javax.media.protocol.SourceStream |
endOfStream, getContentDescriptor, getContentLength |
| Methods inherited from interface javax.media.Controls |
getControl, getControls |
PushBufferStreamAdapter
public PushBufferStreamAdapter(javax.media.protocol.PushSourceStream stream,
javax.media.Format format)
- Initializes a new PushBufferStreamAdapter instance which
reads its data from a specific PushSourceStream with a
specific Format
- Parameters:
stream - the PushSourceStream the new instance is to
read its data fromformat - the Format of the specified input
stream and of the new instance
read
public void read(javax.media.Buffer buffer)
throws IOException
- Implements PushBufferStream#read(Buffer). Delegates to the wrapped
PushSourceStream by allocating a new byte[] buffer of size equal to
PushSourceStream#getMinimumTransferSize().
- Specified by:
read in interface javax.media.protocol.PushBufferStream
- Parameters:
buffer - the Buffer to read
- Throws:
IOException - if I/O related errors occurred during read operation
read
protected int read(byte[] buffer,
int offset,
int length)
throws IOException
- Implements BufferStreamAdapter#read(byte[], int, int). Delegates to the
wrapped PushSourceStream.
- Specified by:
read in class BufferStreamAdapter<javax.media.protocol.PushSourceStream>
- Parameters:
buffer - byte array to readoffset - offset to start readinglength - length to read
- Returns:
- number of bytes read
- Throws:
IOException - if I/O related errors occurred during read operation
setTransferHandler
public void setTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)
- Implements PushBufferStream#setTransferHandler(BufferTransferHandler).
Delegates to the wrapped PushSourceStream by translating the specified
BufferTransferHandler to a SourceTransferHandler.
- Specified by:
setTransferHandler in interface javax.media.protocol.PushBufferStream
- Parameters:
transferHandler - a BufferTransferHandler to set
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.