2016-03-16 51 views
0

我必须从外部存储卡的特定地址读取一些字节。从特定卷地址读取Java从

我没有要读取的文件,而是一个驱动器地址,如何使用Java读取数据?我使用的文件路径读,我从来没有从卷地址读...

回答

0

这是解决方案:

File diskRoot = new File ("\\\\.\\PhysicalDrive0"); 
RandomAccessFile diskAccess = new RandomAccessFile (diskRoot, "r"); 
byte[] content = new byte[1024]; 
diskAccess.readFully(content); 

但是它需要以管理员身份运行。