Logo Search packages:      
Sourcecode: lttoolbox version File versions  Download package

template<class T>
static void EndianUtil< T >::write ( ostream &  os,
T const &  val 
) [inline, static]

Write procedure, C++ I/O version.

output the stream to write to
val the value of the generic object to write to the stream

Definition at line 114 of file EndianUtil.H.

    T val2 = val;
    os.write(reinterpret_cast<char *>(&val2), sizeof(T));
    char *s = reinterpret_cast<char *>(&val2);
    for(int i = sizeof(T)-1; i != -1; i--)
      os.write(&(s[i]), sizeof(char));

Generated by  Doxygen 1.6.0   Back to index