I’m trying to read the file on the FTP remote-server using Apache Commons Net library. retrieveFileStream returns InputStream and put it in BufferedReader. But, I want to use RandomAccessFile (to use the seek() method). I want to get Inputstream as a RandomAccessFile. Is it possible? Answer If you want to starting reading the remote file from a certain offset, use
Tag: randomaccessfile
How to properly close MappedByteBuffer?
This is the code I’m running: Before pressing a key, I’m trying to delete the file manually in FAR Manager. But FAR says that the file is locked: Only after pressing a key, the application terminates and I can delete the file. What is wrong with my code? Answer Try this one.
Reading a log file which gets rolled over
I am trying to use a simple program to read from a log file. The code used is as follows: The code works well for new lines being added to the log file but it does not replicate the rollover process. i.e. when the content of the log file is cleared I expect the java console to continue reading text