WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIScriptableInputStream

IID:a2a32f90-9b90-11d3-a189-0050041caf44
Inherits From:nsISupports
Status:FROZEN

nsIScriptableInputStream provides scriptable access to an nsIInputStream instance.

This interface is intended to be used as an instance. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/scriptableinputstream;1"].
            createInstance(Components.interfaces.nsIScriptableInputStream);

This interface is implemented by the following components:


Methods

PRUint32 available ( ) void close ( ) void init ( nsIInputStream inputStream ) char* read ( PRUint32 count )

PRUint32 available ( )

Return the number of bytes currently available in the stream

Returns:
the number of bytes

void close ( )

Closes the stream.


void init ( nsIInputStream inputStream )

Wrap the given nsIInputStream with this nsIScriptableInputStream.

Arguments:
inputStream: parameter providing the stream to wrap

char* read ( PRUint32 count )

Read data from the stream.

WARNING: If the data contains a null byte, then this method will return a truncated string.

Arguments:
count: the maximum number of bytes to read
Returns:
the data, which will be an empty string if the stream is at EOF.

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com