Package org.jitsi.impl.neomedia.protocol
Class PushBufferStreamAdapter
- java.lang.Object
-
- org.jitsi.impl.neomedia.protocol.BufferStreamAdapter<javax.media.protocol.PushSourceStream>
-
- org.jitsi.impl.neomedia.protocol.PushBufferStreamAdapter
-
- All Implemented Interfaces:
javax.media.Controls,javax.media.protocol.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:
- Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.protocol.BufferStreamAdapter
stream
-
-
Constructor Summary
Constructors Constructor Description 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
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 PushBufferStream#read(Buffer).voidsetTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)Implements PushBufferStream#setTransferHandler(BufferTransferHandler).-
Methods inherited from class org.jitsi.impl.neomedia.protocol.BufferStreamAdapter
endOfStream, getContentDescriptor, getContentLength, getControl, getControls, getFormat, getStream, read
-
-
-
-
Constructor Detail
-
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
-
-
Method Detail
-
read
public void read(javax.media.Buffer buffer) throws IOExceptionImplements PushBufferStream#read(Buffer). Delegates to the wrapped PushSourceStream by allocating a new byte[] buffer of size equal to PushSourceStream#getMinimumTransferSize().- Specified by:
readin interfacejavax.media.protocol.PushBufferStream- Parameters:
buffer- the Buffer to read- Throws:
IOException- if I/O related 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 PushSourceStream.- Specified by:
doReadin classBufferStreamAdapter<javax.media.protocol.PushSourceStream>- Parameters:
buffer-data- 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:
setTransferHandlerin interfacejavax.media.protocol.PushBufferStream- Parameters:
transferHandler- a BufferTransferHandler to set
-
-