How to access specific raw data on disk from java

前端 未结 8 622
一向
一向 2020-11-28 07:59

I\'m trying to use the following code to access one byte with offset of 50 bytes in a raw disk.

randomAccessFile = new RandomAccessFile(\"C:\", \"r\");
rando         


        
8条回答
  •  野性不改
    2020-11-28 08:28

    In windows you need to access the raw device identifier as a file. It should work if you pass in the file "\\.\c:", you are using the device UNC name \.\c: (\. means this machine).

    For Vista and later I don't think it will work correctly as there are mechanisms in place to prevent raw access to the disk for anything other than device drivers (don't quote me on that)

提交回复
热议问题