JAVA - read binary file with header (trying to transfer c++ code) : i have some old C code that does what i need, with the file type i'm working with, but i need to get it into Java.  i've been reading up on binary I/O but i can't figure out how to deal with the header and i don't understand the C code enough to know what it's doing

i would appreciate any assistance - mostly with understanding what the C code means when it uses br.readInt32() and such and how to emulate that with Java which (as i understand it) reads the binary differently

i don't understand binary files very well (nor do i want to, this is a one off code piece), i just want to get the data out then i can work on the code that i understand better.  

thanks

C snippet:
[code]

        public void ConvertEVDtoCSV(string fileName)
        {
            string[] fileArray = File.ReadAllLines(fileName);
            float minX = 0;
            float maxX = 0;

            try
            {
                FileStream fs = new FileStream(fileName, FileMode.Open);
                BinaryReader br = new BinaryReader(fs);

                /*
                    16 + n*80*6 = sizeof(header) where n is the 9th nibble of the file (beginning of the 5th byte)
                */

                //Reads "EVIS" 
                br.ReadBytes(4);
                //Reads numDataSets
                int numDataSets = br.ReadInt32();
                //Reads lngNumPlotSurfaces
                int lngNumPlotSurfaces = br.ReadInt32();
                //Reads headerEvisive length
                int headerEvisive = br.ReadInt32();
                //skip all six title and axes text lines.  
                int remainingHeader = (lngNumPlotSurfaces * 6 * 80) + headerEvisive;

                br.ReadBytes(remainingHeader);      //could also use seek(remainingHeader+16), but streams don't support seek?
                
                long dataSize = numDataSets * (2 + lngNumPlotSurfaces); //meb 6-8-2016: +2 for X and Y
                string[] dataForCSVFile = new string[dataSize];

                for (long cnt = 0; cnt < numDataSets; cnt++)
                {
                    for (int j = 0; j < 2 + lngNumPlotSurfaces; j++)    //+2 for X and Y
                        {
                        //don't read past the end of file
                        if (br.BaseStream.Position<br.BaseStream.Length) {
                        //This is where the data needs to be read in and converted from 32-bit single-precision floating point to strings for the csv file
                        float answerLittle = br.ReadSingle();
                        if (j == 0 && answerLittle > maxX)
                            maxX = answerLittle;
                        if (j == 0 && answerLittle < minX)
                            minX = answerLittle;
                        if (j > lngNumPlotSurfaces)
                            dataForCSVFile[cnt * (2 + lngNumPlotSurfaces) + j] = answerLittle.ToString() + "\r\n";
                        else
                            dataForCSVFile[cnt * (2 + lngNumPlotSurfaces) + j] = answerLittle.ToString() + ",";
                        }
                    }
                }
                fs.Close();
                textBox_x_max.Text = (maxX).ToString("F2");
                textBox_x_min.Text = (minX).ToString("F2");
                StreamWriter sw = new StreamWriter(tempfile);      

                for (int i = 0; i < dataForCSVFile.Length; i++)
                {
                    sw.Write(dataForCSVFile[i]);
                }
                sw.Close(); 
            }
            catch (Exception ex)
            { Console.WriteLine("Error reading data past eof."); }
        }