function O = freader(filename)
%
%   O = freader(filename) - opens the binary file (generated by PETSc for reading)
%
%  This provides an object oriented interface to the Matlab routines fopen(), fread() and fclose()
%  allowing PETSc  Matlab utilities like PetscBinaryRead.m to work cleanly with either binary
%  files or sockets
%
S = struct('fd', fopen(filename,'r','ieee-be'));
O = class(S,'freader');

