Back to index
|void||init (in nsIInputStream aStream, in string aCharset, in long aBufferSize, in PRUnichar aReplacementChar)|
|Initialize this stream. |
|unsigned long||read ([array, size_is(aCount)] in PRUnichar aBuf, in unsigned long aCount)|
|Reads into a caller-provided character array. |
|unsigned long||readSegments (in nsWriteUnicharSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount)|
|Low-level read method that has access to the stream's underlying buffer. |
|unsigned long||readString (in unsigned long aCount, out AString aString)|
|Read into a string object. |
|Close the stream and free associated resources. |
|const PRUnichar||DEFAULT_REPLACEMENT_CHARACTER = 0xFFFD|
|Default replacement char value, U+FFFD REPLACEMENT CHARACTER. |
A unichar input stream that wraps an input stream.
This allows reading unicode strings from a stream, automatically converting the bytes from a selected character encoding.
Close the stream and free associated resources.
This also closes the underlying stream, if any.
|void nsIConverterInputStream::init||(||in nsIInputStream||aStream,|
Initialize this stream.
|aStream||The underlying stream to read from.|
|aCharset||The character encoding to use for converting the bytes of the stream. A null charset will be interpreted as UTF-8.|
|aBufferSize||How many bytes to buffer.|
|aReplacementChar||The character to replace unknown byte sequences in the stream with. The standard replacement character is U+FFFD. A value of 0x0000 will cause an exception to be thrown if unknown byte sequences are encountered in the stream.|
|unsigned long nsIUnicharInputStream::read||(||[array, size_is(aCount)] in PRUnichar||aBuf,|
|in unsigned long||aCount|
Reads into a caller-provided character array.
|unsigned long nsIUnicharInputStream::readSegments||(||in nsWriteUnicharSegmentFun||aWriter,|
|in unsigned long||aCount|
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.
|aWriter||the "consumer" of the data to be read|
|aClosure||opaque parameter passed to writer|
|aCount||the maximum number of characters to be read|
|NS_BASE_STREAM_WOULD_BLOCK||if reading from the input stream would block the calling thread (non-blocking mode only)|
NOTE: this function may be unimplemented if a stream has no underlying buffer
|unsigned long nsIUnicharInputStream::readString||(||in unsigned long||aCount,|
Read into a string object.
|aCount||The number of characters that should be read|