3

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.

jogojapan
  • 68,383
  • 11
  • 101
  • 131
Alex
  • 91
  • 1
  • 8

1 Answers1

1

If you're on *nix, you can just access /dev/sda directly. You'll probably want to use a FileChannel to read and write at arbitrary offsets. Windows is a different story.

David Ehrmann
  • 7,366
  • 2
  • 31
  • 40