title: How to access specific raw data on disk from java
body: <p>I'm trying to use the following code to access one byte with offset of 50 bytes in a raw disk.</p>
  
  <pre><code>randomAccessFile = new RandomAccessFile("C:", "r");
  randomAccessFile.seek(50);
  byte[] buffer = new byte[1];
  randomAccessFile.read(buffer);
  </code></pre>
  
  <p>But all what I get is the following error:</p>
  
  <pre><code>java.io.FileNotFoundException: C: (Acceso denegado)
  at java.io.RandomAccessFile.open(Native Method)
  at java.io.RandomAccessFile.&lt;init&gt;(RandomAccessFile.java:212)
  at java.io.RandomAccessFile.&lt;init&gt;(RandomAccessFile.java:98)
  at pru.lseek.main(lseek.java:26)
  </code></pre>
  
  <p>Is there any way to access a precise byte in a drive from java?</p>