Hello,
I need to read within
Java code a binary file which was written using 'fwrite' method in 'C'.
More specifically I wish to translate the following C code into Java code.
Thanks to anyone who could help.
static int lecture_p1 ( ) {
int ptp1;
if ((pfp1 = fopen(PCP1, "r")) == NULL) {
perror(PCP1);
exit();
}
fread((char * ) &ptp1, sizeof(int), 1, pfp1);
fclose(pfp1);
return ((long) ptp1);
}