+void wxDataOutputStream::Write64(const wxUint64 *buffer, size_t size)
+{
+ if (m_be_order)
+ {
+ for (wxUint32 i=0; i<size ;i++)
+ {
+ wxUint64 i64 = wxUINT64_SWAP_ON_LE(*buffer);
+ buffer++;
+ m_output->Write(&i64, 8);
+ }
+ }
+ else
+ {
+ for (wxUint32 i=0; i<size ;i++)
+ {
+ wxUint64 i64 = wxUINT64_SWAP_ON_BE(*buffer);
+ buffer++;
+ m_output->Write(&i64, 8);
+ }
+ }
+}
+
+void wxDataOutputStream::Write32(const wxUint32 *buffer, size_t size)
+{
+ if (m_be_order)
+ {
+ for (wxUint32 i=0; i<size ;i++)
+ {
+ wxUint32 i32 = wxUINT32_SWAP_ON_LE(*buffer);
+ buffer++;
+ m_output->Write(&i32, 4);
+ }
+ }
+ else
+ {
+ for (wxUint32 i=0; i<size ;i++)
+ {
+ wxUint32 i32 = wxUINT32_SWAP_ON_BE(*buffer);
+ buffer++;
+ m_output->Write(&i32, 4);
+ }
+ }
+}
+
+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;
+}