File diskRoot = new File ("\\\\.\\PhysicalDrive1");
RandomAccessFile diskAccess = new RandomAccessFile (diskRoot, "r");
byte[] content = new byte[512];
diskAccess.readFully (content);
我正在使用上述代码由 PhysicalDrive1 读取,它给了我以下异常:
Exception in thread "main" java.io.FileNotFoundException: \\.\HD1 (The system cannot find the file specified)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at forensictool.ForensicTool.main(ForensicTool.java:43)
Java Result: 1
有没有其他方法可以用来从 Java 中的物理驱动器读取。