BIO is a library of C routines for reading and writing binary data. An option is included for handling data that was written or is to be read on a machine with the opposite byte ordering convention.
These routines come courtesty of Greg Hood, of the Pittsburgh Supercomputing Center.
You can go up one level to the C source codes.