public class InputSourceStream extends Object implements PullSourceStream
DataSource,
SourceStream,
InputStream| Modifier and Type | Field and Description |
|---|---|
protected boolean |
eosReached |
protected InputStream |
stream |
LENGTH_UNKNOWN| Constructor and Description |
|---|
InputSourceStream(InputStream s,
ContentDescriptor type)
Construct an
InputSourceStream from an input stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Turn the stream off.
|
boolean |
endOfStream()
Return if the end of stream has been reached.
|
ContentDescriptor |
getContentDescriptor()
Get the content type for this stream.
|
long |
getContentLength()
Obtain the content length
|
Object |
getControl(String controlName)
Returns
null because no controls are implemented. |
Object[] |
getControls()
Returns an zero length array because no controls
are supported.
|
int |
read(byte[] buffer,
int offset,
int length)
Read a buffer of data.
|
boolean |
willReadBlock()
Query if the next read will block.
|
protected InputStream stream
protected boolean eosReached
public InputSourceStream(InputStream s, ContentDescriptor type)
InputSourceStream from an input stream.s - The input stream to build the source stream from.type - The content-type of the source stream.public ContentDescriptor getContentDescriptor()
getContentDescriptor in interface SourceStreampublic long getContentLength()
getContentLength in interface SourceStreampublic boolean willReadBlock()
willReadBlock in interface PullSourceStreamIOException - thrown when an error
occurs on the stream.public int read(byte[] buffer,
int offset,
int length)
throws IOException
read in interface PullSourceStreambuffer - The buffer to read data into.offset - The offset into the buffer for reading.length - The number of bytes to read.IOException - Thrown if an error occurs while reading.public void close()
throws IOException
IOException - Thrown if there is a problem closing the stream.public boolean endOfStream()
endOfStream in interface SourceStreampublic Object[] getControls()
getControls in interface ControlsObject array.public Object getControl(String controlName)
null because no controls are implemented.getControl in interface Controlsnull.Copyright © 2012 code4tv.com. All Rights Reserved.