That's a lot of code just to do this:
byte[] buffer = File.readAllBytes(filepath);
Yeah, I get it. The entire file is going to be pulled into memory and could run the machine out of RAM. But for a test project just to learn how to parse the data, it'll do just fine.
The trick is interpreting the bytes once you have them. You need to write code for each file type you want to support. The data you get in the buffer is NOT going to be interpreted for you.