|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.os.Handler
android.webkit.StreamLoader
abstract class StreamLoader
This abstract class is used for all content loaders that rely on streaming content into the rendering engine loading framework. The class implements a state machine to load the content into the frame in a similar manor to the way content arrives from the network. The class uses messages to move from one state to the next, which enables async. loading of the streamed content. Classes that inherit from this class must implement two methods, the first method is used to setup the InputStream and notify the loading framework if it can load it's content. The other method allows the derived class to add additional HTTP headers to the response. By default, content loaded with a StreamLoader is marked with a HTTP header that indicates the content should not be cached.
| Field Summary | |
|---|---|
protected long |
mContentLength
|
protected InputStream |
mDataStream
|
protected LoadListener |
mHandler
|
static String |
NO_STORE
|
| Constructor Summary | |
|---|---|
StreamLoader(LoadListener loadlistener)
Constructor. |
|
| Method Summary | |
|---|---|
protected abstract void |
buildHeaders(Headers headers)
This method is called when the headers are about to be sent to the load framework. |
void |
handleMessage(Message msg)
Subclasses must implement this to receive messages. |
void |
load()
Calling this method starts the load of the content for this StreamLoader. |
protected abstract boolean |
setupStreamAndSendStatus()
This method is called when the derived class should setup mDataStream, and call mHandler.status() to indicate that the load can occur. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String NO_STORE
protected LoadListener mHandler
protected InputStream mDataStream
protected long mContentLength
| Constructor Detail |
|---|
StreamLoader(LoadListener loadlistener)
loadlistener - The LoadListener to call with the data.| Method Detail |
|---|
protected abstract boolean setupStreamAndSendStatus()
protected abstract void buildHeaders(Headers headers)
headers - Map of HTTP headers that will be sent to the loader.public void load()
public void handleMessage(Message msg)
Handler
handleMessage in class Handler
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||