|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.protocol.InputSourceStream
Build a source stream out of an input stream.
DataSource
,
SourceStream
,
InputStream
Field Summary | |
(package private) ContentDescriptor |
contentType
|
protected boolean |
eosReached
|
protected java.io.InputStream |
stream
|
Fields inherited from interface javax.media.protocol.SourceStream |
LENGTH_UNKNOWN |
Constructor Summary | |
InputSourceStream(java.io.InputStream s,
ContentDescriptor type)
Construct an InputSourceStream from an input stream. |
Method Summary | |
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 |
java.lang.Object |
getControl(java.lang.String controlName)
Returns null because no controls are implemented. |
java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.InputStream stream
protected boolean eosReached
ContentDescriptor contentType
Constructor Detail |
public InputSourceStream(java.io.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.Method Detail |
public ContentDescriptor getContentDescriptor()
getContentDescriptor
in interface SourceStream
public long getContentLength()
getContentLength
in interface SourceStream
public boolean willReadBlock()
willReadBlock
in interface PullSourceStream
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in interface PullSourceStream
buffer
- The buffer to read data into.offset
- The offset into the buffer for reading.length
- The number of bytes to read.
java.io.IOException
- Thrown if an error occurs while reading.public void close() throws java.io.IOException
java.io.IOException
- Thrown if there is a problem closing the stream.public boolean endOfStream()
endOfStream
in interface SourceStream
public java.lang.Object[] getControls()
getControls
in interface Controls
Object
array.public java.lang.Object getControl(java.lang.String controlName)
null
because no controls are implemented.
getControl
in interface Controls
null
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |