I need to convert the fread function in C into java.
fread(buf,size, noOfItemsRead, stream)
The fread function stores the read bytes into the an area of memory specified by the arugments. How do i do this in Java?
In the C program that I have,
the variable, mat, is a struct.
&mat is passed into fread as the buffer.
The next thing I know, the object is already initialised with values. How is this done in Java?
Currently, I am using the read(byte) of the FileInputStream. How do i use the bytes stored into the array to initialise an Object type?