Try java.io.RandomAccessFile.
Call RandomAccessFile#seek() to position the file pointer correctly
and then call one or more of the read(..) methods available in the
RandomAccessFile class. Or you could go balls deep and use a
FileChannel, but that is about as fun as pleasuring yourself with a
Thanks Jens,
I already found a simple solution, to use skip() method:
InputStream is = new FileInputStream(file);
byte[] output = new byte[(int) bytesToRead];
is.skip(startPosition);
is.read(output, 0, bytesToRead);
and it seems to work good.
--
You received this message because you are
2 matches
Mail list logo