nsIScriptableInputStream provides scriptable access to the nsIInputStream.  

 @status FROZEN
[scriptable, uuid(a2a32f90-9b90-11d3-a189-0050041caf44)]
interface nsIScriptableInputStream : nsISupports

Methods

 Return the number of bytes currently available in the stream 
  @param _retval [out] parameter to hold the number of bytes 
         if an error occurs, the parameter will be undefined 
  @return error status 
unsigned long available()
 
 Closes the stream. 
void close()
 Wrap the given nsIInputStream with this nsIScriptableInputStream. 
  @param aInputStream [in] parameter providing the stream to wrap 
void init(in nsIInputStream aInputStream)
 Read data from the stream. 
  @param aCount [in] the maximum number of bytes to read 
  @param _retval [out] the data
string read(in unsigned long aCount)