To see how to use the FileInputStream's read() method, read the API doc. One of the overloads for read has a byte array and number of bytes to read.
Both of those to be compared are arrays. The == test will be to see if the two variables point to the same array.Quote:
f(data == jpgSOI)
To test if the contents of the arrays are equal, you'll have to find/write a method to compare them element by element.
Perhaps the Arrays class has a method.