nsIConverterInputStream
From MDC
Allows reading unicode strings from a stream, automatically converting the bytes from a selected character encoding.
Contents |
nsIConverterInputStream is defined in xpcom/io/nsIConverterInputStream.idl. It is scriptable and
unfrozen (hasn't changed since Mozilla 1.8b3).
Inherits from: nsIUnicharInputStream
Implemented by: @mozilla.org/intl/converter-input-stream;1
See Reading textual data for an example.
[edit] Methods
[edit] init()
void init (in nsIInputStream aStream, in string aCharset,
in long aBufferSize, in PRUnichar aReplacementChar);
[edit] Parameters
aStream
The source stream which is read and converted.
aCharset
Defines how the bytes of the Stream should be interpreted and converted. A value of NULL or "UTF-8" equals UTF-8 encoding. Latin 1 equals "ISO-8859-1".
aBufferSize
Defines the buffer size of the converter stream. In case of a buffer size of less or equal 0, the default size CONVERTER_BUFFER_SIZE will be used. This is currently set to 8192 Bytes
aReplacementChar
Any unknown byte sequence will be replaced with this character. The default 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.