0
File diskRoot = new File ("\\\\.\\PhysicalDrive1");
    RandomAccessFile diskAccess = new RandomAccessFile (diskRoot, "r");
    byte[] content = new byte[512];
    diskAccess.readFully (content);

I am using the above mentioned code to read by PhysicalDrive1 and it gives me the following exception:

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

Is there any other method I can use to read from a physical drive in Java.

0 Answers0