Methods Summary |
---|
public void | close()Turn the stream off.
stream.close();
|
public boolean | endOfStream()Return if the end of stream has been reached.
return eosReached;
|
public javax.media.protocol.ContentDescriptor | getContentDescriptor()Get the content type for this stream.
return contentType;
|
public long | getContentLength()Obtain the content length
return SourceStream.LENGTH_UNKNOWN;
|
public java.lang.Object | getControl(java.lang.String controlName)Returns null because no controls are implemented.
return null;
|
public java.lang.Object[] | getControls()Returns an zero length array because no controls
are supported.
return new Object[0];
|
public int | read(byte[] buffer, int offset, int length)Read a buffer of data.
int bytesRead = stream.read(buffer, offset, length);
if( bytesRead == -1) {
eosReached = true;
}
return bytesRead;
|
public boolean | willReadBlock()Query if the next read will block.
if( eosReached == true) {
return true;
} else {
try {
return stream.available() == 0;
} catch (IOException e) {
return true;
}
}
|