From another question in the link below I'm reading a data file I want to read a data file word not just byte with values above 255, how do I do this? and exact offset if possible
There were replys to using RandomAcessFile but I cant get it working any help?
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
public class ReadTest {
public static void main(String[] args)throws IOException {
byte[] magic = new byte[4];
File file = new File("D://test.map");
RandomAccessFile raf = new RandomAccessFile(file );
raf.seek(0L);
raf.readFully(magic);
System.out.println(new String(magic));
}
}
error line 13 "RandomAccessFile raf = new RandomAccessFile(file );"