net.sf.fmj.media.multiplexer
Class InputStreamPushSourceStream

java.lang.Object
  extended by net.sf.fmj.media.multiplexer.InputStreamPushSourceStream
All Implemented Interfaces:
Controls, PushSourceStream, SourceStream

public class InputStreamPushSourceStream
extends java.lang.Object
implements PushSourceStream

Adapater from InputStream to PushSourceStream.

Author:
Ken Larson

Field Summary
 
Fields inherited from interface javax.media.protocol.SourceStream
LENGTH_UNKNOWN
 
Constructor Summary
InputStreamPushSourceStream(ContentDescriptor outputContentDescriptor, java.io.InputStream is)
           
 
Method Summary
 boolean endOfStream()
           
 ContentDescriptor getContentDescriptor()
           
 long getContentLength()
           
 java.lang.Object getControl(java.lang.String controlType)
           
 java.lang.Object[] getControls()
           
 int getMinimumTransferSize()
           
 void notifyDataAvailable()
           
 int read(byte[] buffer, int offset, int length)
          According to API: Read from the stream without blocking.
 void setTransferHandler(SourceTransferHandler transferHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamPushSourceStream

public InputStreamPushSourceStream(ContentDescriptor outputContentDescriptor,
                                   java.io.InputStream is)
Method Detail

getMinimumTransferSize

public int getMinimumTransferSize()
Specified by:
getMinimumTransferSize in interface PushSourceStream

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws java.io.IOException
Description copied from interface: PushSourceStream
According to API: Read from the stream without blocking. Returns -1 when the end of the media is reached. This implies that it can return zero if there is no data available.

Specified by:
read in interface PushSourceStream
Throws:
java.io.IOException

setTransferHandler

public void setTransferHandler(SourceTransferHandler transferHandler)
Specified by:
setTransferHandler in interface PushSourceStream

notifyDataAvailable

public void notifyDataAvailable()

endOfStream

public boolean endOfStream()
Specified by:
endOfStream in interface SourceStream

getContentDescriptor

public ContentDescriptor getContentDescriptor()
Specified by:
getContentDescriptor in interface SourceStream

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface SourceStream

getControl

public java.lang.Object getControl(java.lang.String controlType)
Specified by:
getControl in interface Controls

getControls

public java.lang.Object[] getControls()
Specified by:
getControls in interface Controls