#include "petsc.h" int PetscBinaryWrite(int fd,void *p,int n,PetscDataType type,int istemp)Not Collective
fd | - the file | |
p | - the buffer | |
n | - the number of items to write | |
type | - the type of items to read (PETSC_INT, PETSC_DOUBLE or PETSC_SCALAR) | |
istemp | - 0 if buffer data should be preserved, 1 otherwise. |
The Buffer p should be read-write buffer, and not static data. This way, byte-swapping is done in-place, and then the buffer is written to the file.
This routine restores the original contents of the buffer, after it is written to the file. This is done by byte-swapping in-place the second time. If the flag istemp is set to 1, the second byte-swapping operation is not done, thus saving some computation, but the buffer corrupted is corrupted.
Level:advanced
Location:src/sys/src/fileio/sysio.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages