1 \section{\class{wxDataOutputStream
}}\label{wxdataoutputstream
}
3 This class provides functions that write binary data types in a
4 portable way. Data can be written in either big-endian or little-endian
5 format, little-endian being the default on all architectures.
7 If you want to write data to text files (or streams) use
8 \helpref{wxTextOutputStream
}{wxtextoutputstream
} instead.
10 The << operator is overloaded and you can use this class like a standard
11 C++ iostream. See
\helpref{wxDataInputStream
}{wxdatainputstream
} for its
14 See also
\helpref{wxDataInputStream
}{wxdatainputstream
}.
16 \wxheading{Derived from
}
20 \latexignore{\rtfignore{\wxheading{Members
}}}
22 \membersection{wxDataOutputStream::wxDataOutputStream
}\label{wxdataoutputstreamconstr
}
24 \func{}{wxDataOutputStream
}{\param{wxOutputStream\&
}{ stream
}}
26 \func{}{wxDataOutputStream
}{\param{wxOutputStream\&
}{ stream
},
\param{wxMBConv\&
}{ conv = wxMBConvUTF8
}}
28 Constructs a datastream object from an output stream. Only write methods will
29 be available. The second form is only available in Unicode build of wxWindows.
31 \wxheading{Parameters
}
33 \docparam{stream
}{The output stream.
}
35 \docparam{conv
}{Charset conversion object object used to encoding Unicode
36 strings before writing them to the stream
37 in Unicode mode (see
\helpref{wxDataOutputStream::WriteString
}{wxdataoutputstreamwritestring
}
38 documentation for detailed description). Note that you must not destroy
39 {\it conv
} before you destroy this wxDataOutputStream instance! It is
40 recommended to use default value (UTF-
8).
}
42 \membersection{wxDataOutputStream::
\destruct{wxDataOutputStream
}}
44 \func{}{\destruct{wxDataOutputStream
}}{\void}
46 Destroys the wxDataOutputStream object.
48 \membersection{wxDataOutputStream::BigEndianOrdered
}
50 \func{void
}{BigEndianOrdered
}{\param{bool
}{ be
\_order}}
52 If
{\it be
\_order} is TRUE, all data will be written in big-endian
53 order, e.g. for reading on a Sparc or from Java-Streams (which
54 always use big-endian order), otherwise data will be written in
57 \membersection{wxDataOutputStream::Write8
}
59 \func{void
}{Write8
}{{\param wxUint8
}{i8
}}
61 Writes the single byte
{\it i8
} to the stream.
63 \membersection{wxDataOutputStream::Write16
}
65 \func{void
}{Write16
}{{\param wxUint16
}{i16
}}
67 Writes the
16 bit unsigned integer
{\it i16
} to the stream.
69 \membersection{wxDataOutputStream::Write32
}
71 \func{void
}{Write32
}{{\param wxUint32
}{i32
}}
73 Writes the
32 bit unsigned integer
{\it i32
} to the stream.
75 \membersection{wxDataOutputStream::Write64
}
77 \func{void
}{Write64
}{{\param wxUint64
}{i64
}}
79 Writes the
64 bit unsigned integer
{\it i64
} to the stream.
81 \membersection{wxDataOutputStream::WriteDouble
}
83 \func{void
}{WriteDouble
}{{\param double
}{f
}}
85 Writes the double
{\it f
} to the stream using the IEEE format.
87 \membersection{wxDataOutputStream::WriteString
}\label{wxdataoutputstreamwritestring
}
89 \func{void
}{WriteString
}{{\param const wxString\&
}{string
}}
91 Writes
{\it string
} to the stream. Actually, this method writes the size of
92 the string before writing
{\it string
} itself.
94 In ANSI build of wxWindows, the string is written to the stream in exactly
95 same way it is represented in memory. In Unicode build, however, the string
96 is first converted to multibyte representation with
{\it conv
} object passed
97 to stream's constructor (consequently, ANSI application can read data
98 written by Unicode application, as long as they agree on encoding) and this
99 representation is written to the stream. UTF-
8 is used by default.