Module: Advanced Tools Package: Streams
RWUCharToByteOutputStreamImp RWUCharOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase
close() flush() getSinkStream() |
isBad() isFail() isGood() |
make() RWUCharToByteOutputStreamImp() write() |
~RWUCharToByteOutputStreamImp() |
#include <rw/stream/RWUCharToByteOutputStreamImp.h>
Concrete class connecting a Unicode character stream to a binary stream. The UTF-16 characters are written as a sequence of bytes using the byte ordering (little endian, or big endian) supported by the system on which the code is executed. The UTF-16 character U+FEFF is inserted in the stream as first character to let input streams figure out the byte ordering used when generating the output byte sequence. Implements the body idiom from the handle-body pattern.
RWUCharToByteOutputStreamImp(RWByteOutputStream& sinkStream);
Initializes the reference to the binary stream that will be used as the sink of bytes, and writes the stream header (U+FEFF).
Parameter List
sinkStream |
The binary stream that will serve as the sink of bytes. |
virtual ~RWUCharToByteOutputStreamImp();
Destructor.
static RWUCharOutputStream make(RWByteOutputStream& sink);
Constructs an RWUCharToByteOutputStreamImp instance that uses sink as its sink of bytes, and returns a handle to it.
Parameter List
sink |
The binary stream that is used as the sink of bytes. |
virtual void close();
This function is forwarded to the binary stream used as the sink of bytes.
virtual void flush();
This function is forwarded to the binary stream used as the sink of bytes.
virtual bool isBad() const;
This function is forwarded to the binary stream used as the sink of bytes. Throws no exceptions.
virtual bool isFail() const;
This function is forwarded to the binary stream used as the sink of bytes. Throws no exceptions.
virtual bool isGood() const;
This function is forwarded to the binary stream used as the sink of bytes. Throws no exceptions.
virtual void write(RWUChar unicodeValue);
Writes a single UTF-16 character to the binary stream used as the sink of bytes.
Parameter List
unicodeValue |
The UTF-16 character to be written. |
virtual void write(const RWUChar* unicodeArray, RWSize numUChars);
Writes an array of UTF-16 characters to the stream used as the sink of bytes.
Parameter List
unicodeArray |
A pointer to the first element of the array. |
numUChars |
The number of UTF-16 characters to be written. |
RWByteOutputStream& getSinkStream(); const RWByteOutputStream& getSinkStream() const;
These functions return a reference to the binary stream that is used as the sink of bytes. They throw no exceptions.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.