|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is a stream listener that provides various methods, such as notification that data is available in the input stream, that the URL has started to load, that it has stopped loading, etc.
Field Summary | |
static int |
STREAM_TYPE_AS_FILE
Indicates file stream type. |
static int |
STREAM_TYPE_AS_FILE_ONLY
Indicates file-only stream type. |
static int |
STREAM_TYPE_NORMAL
Indicates normal stream type. |
static int |
STREAM_TYPE_SEEK
Indicates seek stream type. |
Method Summary | |
int |
getStreamType()
Returns the type of stream. |
void |
onDataAvailable(PlugletStreamInfo streamInfo,
java.io.InputStream input,
int length)
This would be called by the browser to indicate that data is available in the input stream. |
void |
onFileAvailable(PlugletStreamInfo streamInfo,
java.lang.String fileName)
This would be called by the browser to indicate the availability of a local file name for the stream data. |
void |
onStartBinding(PlugletStreamInfo streamInfo)
This would be called by the browser to indicate that the URL has started to load. |
void |
onStopBinding(PlugletStreamInfo streamInfo,
int status)
This would be called by the browser to indicate that the URL has finished loading. |
Field Detail |
public static final int STREAM_TYPE_NORMAL
In this mode, the browser "pushes" data to the Pluglet as it arrives from the network.
public static final int STREAM_TYPE_SEEK
In this mode, the Pluglet can randomly access ("pull") stream data.
public static final int STREAM_TYPE_AS_FILE
In this mode, the browser delivers ("pushes") data to the Pluglet as data is saved to a local file. The data is delivered to the Pluglet via a series of write calls.
public static final int STREAM_TYPE_AS_FILE_ONLY
In this mode, the browser saves stream data to a local file and when it is done, it sends the full path of the file to the Pluglet (which can then "pull" the data).
Method Detail |
public void onStartBinding(PlugletStreamInfo streamInfo)
plugletInfo
- This is the interface (of type PlugletStreamInfo
)
through which the listener can get specific information about the stream, such as
MIME type, URL, date modified, etc.public void onDataAvailable(PlugletStreamInfo streamInfo, java.io.InputStream input, int length)
STREAM_TYPE_AS_FILE_ONLY
. In the latter case,
onFileAvailable
returns the path to the saved stream, and the
Pluglet can then "pull" the data.streamInfo
- This is the interface (of type PlugletStreamInfo
)
through which the listener can get specific information about the stream, such as
MIME type, URL, date modified, etc.input
- The input stream containing the data. This stream can
be either a blocking or non-blocking stream.length
- The amount of data that was just pushed into the stream.public void onFileAvailable(PlugletStreamInfo streamInfo, java.lang.String fileName)
streamInfo
- This is the interface (of type PlugletStreamInfo
)
through which the listener can get specific information about the stream, such as
MIME type, URL, date modified, etc.fileName
- This specifies the full path to the file.public void onStopBinding(PlugletStreamInfo streamInfo, int status)
streamInfo
- This is the interface (of type PlugletStreamInfo
)
through which the listener can get specific information about the stream, such as
MIME type, URL, date modified, etc.status
- This is an int
(integer) to indicate the success
or failure of the load. 0
(NS_OK
) indicates successful
loading; any other value indicates failure.public int getStreamType()
int
- This is an interger representing the stream type:
1 for STREAM_TYPE_NORMAL
2 for STREAM_TYPE_SEEK
3 for STREAM_TYPE_AS_FILE
4 for STREAM_TYPE_AS_FILE_ONLY
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |