First of all I have a couple hours experience with Java so, If its a bit simple question, sorry about that.
Now, I want to read a file but I dont want to start at the beginning of file instead I want to skip first 1024 bytes and than start reading. Is there a way to do that ? I realized that RandomAccessFile might be useful but I'm not sure.
try {
FileInputStream inputStream=new FileInputStream(fName);
// skip 1024 bytes somehow and start reading .
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
You will want to use the FileInputStream.skip
method to seek to the point you want and then begin reading from that point. There is more information in the javadocs about FileInputStream
that you might find interesting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With