8 #ifndef FI_SWAPPED_IO_H
9 #define FI_SWAPPED_IO_H
19 int nChar =
sizeof(T);
20 size_t nBytes =
FT_read(p,nChar,1,fd);
21 for (
int i = nChar-1; i > 0; i--, q++)
31 int nChar =
sizeof(T);
32 char* p = (
char*)&val;
33 char* q = (
char*)(&swappedValue);
34 for (
int i = nChar-1; i > 0; i--, q++)
38 return FT_write(&swappedValue,nChar,1,fd);
Functions and data type for direct access of large binary files.
#define FT_FILE
File pointer.
Definition: FFaIO.H:136
#define FT_read(buf, n, m, f)
Reads an array from file.
Definition: FFaIO.H:118
#define FT_write(buf, n, m, f)
Writes an array to file.
Definition: FFaIO.H:120
Definition: FiSwappedIO.H:15
size_t writeSwapped(const T val, FT_FILE fd)
Definition: FiSwappedIO.H:28
size_t readSwapped(char *q, T &, FT_FILE fd)
Definition: FiSwappedIO.H:16