+
+void wxDataOutputStream::Write16(const wxUint16 *buffer, size_t size)
+{
+ if (m_be_order)
+ {
+ for (wxUint32 i=0; i<size ;i++)
+ {
+ wxUint16 i16 = wxUINT16_SWAP_ON_LE(*buffer);
+ buffer++;
+ m_output->Write(&i16, 2);
+ }
+ }
+ else
+ {
+ for (wxUint32 i=0; i<size ;i++)
+ {
+ wxUint16 i16 = wxUINT16_SWAP_ON_BE(*buffer);
+ buffer++;
+ m_output->Write(&i16, 2);
+ }
+ }
+}
+
+void wxDataOutputStream::Write8(const wxUint8 *buffer, size_t size)
+{
+ m_output->Write(buffer, size);
+}
+
+void wxDataOutputStream::WriteDouble(const double *buffer, size_t size)
+{
+ for (wxUint32 i=0; i<size; i++)
+ {
+ WriteDouble(*(buffer++));
+ }
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(const wxChar *string)
+{
+ Write32(wxStrlen(string));
+ m_output->Write((const char *)string, wxStrlen(string)*sizeof(wxChar));
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(const wxString& string)
+{
+ WriteString(string);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxInt8 c)
+{
+ Write8((wxUint8)c);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxInt16 i)
+{
+ Write16((wxUint16)i);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxInt32 i)
+{
+ Write32((wxUint32)i);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxUint8 c)
+{
+ Write8(c);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxUint16 i)
+{
+ Write16(i);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxUint32 i)
+{
+ Write32(i);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(wxUint64 i)
+{
+ Write64(i);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(double f)
+{
+ WriteDouble(f);
+ return *this;
+}
+
+wxDataOutputStream& wxDataOutputStream::operator<<(float f)
+{
+ WriteDouble((double)f);
+ return *this;
+}
+
+#endif
+ // wxUSE_STREAMS
+