net.java.sip.communicator.impl.neomedia.protocol
Class PullBufferStreamAdapter
java.lang.Object
net.java.sip.communicator.impl.neomedia.protocol.BufferStreamAdapter<javax.media.protocol.PullSourceStream>
net.java.sip.communicator.impl.neomedia.protocol.PullBufferStreamAdapter
- All Implemented Interfaces:
- javax.media.Controls, javax.media.protocol.PullBufferStream, javax.media.protocol.SourceStream
public class PullBufferStreamAdapter
- extends BufferStreamAdapter<javax.media.protocol.PullSourceStream>
- implements javax.media.protocol.PullBufferStream
Represents a PullBufferStream which reads its data from a
specific PullSourceStream.
- Author:
- Lubomir Marinov
| Fields inherited from interface javax.media.protocol.SourceStream |
LENGTH_UNKNOWN |
|
Constructor Summary |
PullBufferStreamAdapter(javax.media.protocol.PullSourceStream stream,
javax.media.Format format)
Initializes a new PullBufferStreamAdapter instance which
reads its data from a specific PullSourceStream with a
specific Format |
|
Method Summary |
void |
read(javax.media.Buffer buffer)
Implements PullBufferStream#read(Buffer). |
protected int |
read(byte[] buffer,
int offset,
int length)
Implements BufferStreamAdapter#read(byte[], int, int). |
boolean |
willReadBlock()
Implements PullBufferStream#willReadBlock(). |
| 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.PullBufferStream |
getFormat |
| Methods inherited from interface javax.media.protocol.SourceStream |
endOfStream, getContentDescriptor, getContentLength |
| Methods inherited from interface javax.media.Controls |
getControl, getControls |
PullBufferStreamAdapter
public PullBufferStreamAdapter(javax.media.protocol.PullSourceStream stream,
javax.media.Format format)
- Initializes a new PullBufferStreamAdapter instance which
reads its data from a specific PullSourceStream with a
specific Format
- Parameters:
stream - the PullSourceStream 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 PullBufferStream#read(Buffer). Delegates to the wrapped
PullSourceStream by either allocating a new byte[] buffer or using the
existing one in the specified Buffer.
- Specified by:
read in interface javax.media.protocol.PullBufferStream
- Parameters:
buffer - Buffer to read
- Throws:
IOException - if I/O 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 PullSourceStream.
- Specified by:
read in class BufferStreamAdapter<javax.media.protocol.PullSourceStream>
- Parameters:
buffer - byte array to readoffset - to start readinglength - length to read
- Returns:
- number of bytes read
- Throws:
IOException - if I/O related errors occurred during read operation
willReadBlock
public boolean willReadBlock()
- Implements PullBufferStream#willReadBlock(). Delegates to the wrapped
PullSourceStream.
- Specified by:
willReadBlock in interface javax.media.protocol.PullBufferStream
- Returns:
- true if this stream will block on read operation, false otherwise
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.