nsIUnicharInputStream

IID:d5e3bd80-6723-4b92-b0c9-22f6162fd94f
Inherits From:nsISupports

Methods

void close ( ) [noscript] PRUint32 read ( arrayof PRUnichar buf , PRUint32 count ) [noscript] PRUint32 readSegments ( nsWriteUnicharSegmentFun writer , voidPtr* closure , PRUint32 count ) PRUint32 readString ( PRUint32 count , out AString string )

void close ( )

Close the stream and free associated resources. This also closes the underlying stream, if any.


PRUint32 read ( arrayof PRUnichar buf , PRUint32 count )

Reads into a caller-provided character array.

Arguments:
buf
count
Returns:
The number of characters that were successfully read. May be less than aCount, even if there is more data in the input stream. A return value of 0 means EOF.

PRUint32 readSegments ( nsWriteUnicharSegmentFun writer , voidPtr* closure , PRUint32 count )

Low-level read method that has access to the stream's underlying buffer. The writer function may be called multiple times for segmented buffers. ReadSegments is expected to keep calling the writer until either there is nothing left to read or the writer returns an error. ReadSegments should not call the writer with zero characters to consume.

NOTE: this function may be unimplemented if a stream has no underlying buffer

Arguments:
writer: the "consumer" of the data to be read
closure: opaque parameter passed to writer
count: the maximum number of characters to be read
Returns:
0 if reached end of file (or if aWriter refused to consume data)

PRUint32 readString ( PRUint32 count , out AString string )

Read into a string object.

Arguments:
count: The number of characters that should be read
string
Returns:
The number of characters that were read.

References

This interface is passed as an argument to the following methods:

nsIUnicharStreamLoaderObserver.onStreamComplete

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com