:orphan:
# PetscViewerBinaryRead
Reads from a binary file, all processors get the same result
## Synopsis
```
#include "petscviewer.h"
PetscErrorCode PetscViewerBinaryRead(PetscViewer viewer, void *data, PetscInt num, PetscInt *count, PetscDataType dtype)
```
Collective
## Input Parameters
- ***viewer -*** the `PETSCVIEWERBINARY` viewer
- ***num -*** number of items of data to read
- ***dtype -*** type of data to read
## Output Parameters
- ***data -*** location of the read data, treated as an array of the type indicated by `dtype`
- ***count -*** number of items of data actually read, or `NULL`.
## See Also
[](sec_viewers), `PETSCVIEWERBINARY`, `PetscViewerASCIIOpen()`, `PetscViewerPushFormat()`, `PetscViewerDestroy()`,
`VecView()`, `MatView()`, `VecLoad()`, `MatLoad()`, `PetscViewerBinaryGetDescriptor()`,
`PetscViewerBinaryGetInfoPointer()`, `PetscFileMode`, `PetscViewer`, `PetscViewerBinaryRead()`
## Level
beginner
## Location
src/sys/classes/viewer/impls/binary/binv.c
## Examples
src/ts/tutorials/ex11_sa.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/binary/binv.c)
[Index of all Viewer routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)