Reads from a binary file.
PetscErrorCode PetscBinaryRead(int fd,void *p,PetscInt n,PetscDataType type)
|fd ||- the file
|n ||- the number of items to read
|type ||- the type of items to read (PETSC_INT, PETSC_DOUBLE or PETSC_SCALAR)
p -the buffer
PetscBinaryRead() uses byte swapping to work on all machines; the files
are written to file ALWAYS using big-endian ordering. On small-endian machines the numbers
are converted to the small-endian format when they are read in from the file.
Integers are stored on the file as 32 bits long, regardless of whether
they are stored in the machine as 32 bits or 64 bits, this means the same
binary file may be read on any machine.
PetscBinaryWrite(), PetscBinaryOpen(), PetscBinaryClose(), PetscViewerBinaryGetDescriptor()
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages