Package org.jitsi.impl.neomedia.protocol
Class PullBufferStreamAdapter
- java.lang.Object
-
- org.jitsi.impl.neomedia.protocol.BufferStreamAdapter<javax.media.protocol.PullSourceStream>
-
- org.jitsi.impl.neomedia.protocol.PullBufferStreamAdapter
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.protocol.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:
- Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.protocol.BufferStreamAdapter
stream
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intdoRead(javax.media.Buffer buffer, byte[] data, int offset, int length)Implements BufferStreamAdapter#doRead(Buffer, byte[], int, int).voidread(javax.media.Buffer buffer)Implements PullBufferStream#read(Buffer).booleanwillReadBlock()Implements PullBufferStream#willReadBlock().-
Methods inherited from class org.jitsi.impl.neomedia.protocol.BufferStreamAdapter
endOfStream, getContentDescriptor, getContentLength, getControl, getControls, getFormat, getStream, read
-
-
-
-
Constructor Detail
-
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
-
-
Method Detail
-
read
public void read(javax.media.Buffer buffer) throws IOExceptionImplements 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:
readin interfacejavax.media.protocol.PullBufferStream- Parameters:
buffer- Buffer to read- Throws:
IOException- if I/O errors occurred during read operation
-
doRead
protected int doRead(javax.media.Buffer buffer, byte[] data, int offset, int length) throws IOExceptionImplements BufferStreamAdapter#doRead(Buffer, byte[], int, int). Delegates to the wrapped PullSourceStream.- Specified by:
doReadin classBufferStreamAdapter<javax.media.protocol.PullSourceStream>- Parameters:
buffer-data- 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:
willReadBlockin interfacejavax.media.protocol.PullBufferStream- Returns:
- true if this stream will block on read operation, false otherwise
-
-