
#ifndef __WFX_IO_ENDIANAWAREOUTPUTSTREAM_H__
#define __WFX_IO_ENDIANAWAREOUTPUTSTREAM_H__

#include <WFX/WFXIncludes.h>
#include <WFX/io/OutputStreamDecorator.h>
#include <WFX/util/EndianConvert.h>

namespace WFX {

    namespace io {

        /**
         * Outputstream decorator base class
         */
        class EndianAwareOutputStream : public OutputStreamDecorator {
            public:
                /** Ctor */
                EndianAwareOutputStream(OutputStream* s);
                virtual ~EndianAwareOutputStream();

                /** output operators */
                void operator <<(Int i);
                void operator <<(UInt i);
                void operator <<(Long i);
                void operator <<(ULong i);
                void operator <<(Short i);
                void operator <<(UShort i);
                void operator <<(Char i);
                void operator <<(UChar i);
                void operator <<(Real r);
                
            protected:
            private:
                /** Endianess converter */
                WFX::util::EndianConvert* Converter;
        };

    }

}

#endif //include guard


