I develop application and write in Java. My application needs access to MBR of USB flash and to content of its sectors. I thought about using JNI: call methods in Java, their implementation is in C++, use only standard C functions, no WinAPI, no Linux API.
And I don't know about possibility of working with such devices in Java without C++.
Tell me please the best way.
If you're on *nix, you can just access
/dev/sda
directly. You'll probably want to use aFileChannel
to read and write at arbitrary offsets. Windows is a different story.