#ifndef NETORDER_H
#define NETORDER_H
+#include <iostream>
+
/* netorder.cpp */
-void *strreverse (void *dest, const void *src, size_t n);
bool read_nint16 (kuint16 *n, int fd);
bool write_nint16 (kuint16 const *n, int fd);
bool read_nint32 (kuint32 *n, int fd);
bool write_nfloat32 (float const *f, int fd);
bool read_nfloat64 (double *d, int fd);
bool write_nfloat64 (double const *d, int fd);
-void ConvertNetworkOrder (void* buffer, size_t bytes);
-void ConvertReverseNetworkOrder (void* buffer, size_t bytes);
+void ConvertNetworkOrder (void* buffer, size_t bytes);
+void ConvertReverseNetworkOrder (void* buffer, size_t bytes);
+
+class inetorderstream : public istream {
+ public:
+ inetorderstream& readInt16 (kuint16& n);
+ inetorderstream& readInt32 (kuint32& n);
+ inetorderstream& readFloat32 (kfloat32& n);
+ inetorderstream& readFloat64 (kfloat64& n);
+};
+
+class onetorderstream : public ostream {
+ public:
+ onetorderstream& writeInt16 (kuint16 n);
+ onetorderstream& writeInt32 (kuint32 n);
+ onetorderstream& writeFloat32 (kfloat32 n);
+ onetorderstream& writeFloat64 (kfloat64 n);
+};
+
+void read_rnint16 (kuint16& n, istream istr);
+void write_rnint16 (kuint16 n, ostream ostr);
+void read_rnint32 (kuint32& n, istream istr);
+void write_rnint32 (kuint32 n, ostream ostr);
+void read_rnfloat32 (kfloat32& n, istream istr);
+void write_rnfloat32 (kfloat32 n, ostream ostr);
+void read_rnfloat64 (kfloat64& n, istream istr);
+void write_rnfloat64 (kfloat64 n, ostream ostr);
#endif