How do I write a Java text file viewer for big log files

Posted by Hannes de Jager on Stack Overflow See other posts from Stack Overflow or by Hannes de Jager
Published on 2010-05-20T12:59:10Z Indexed on 2010/05/20 13:20 UTC
Read the original article Hit count: 165

I am working on a software product with an integrated log file viewer. Problem is, its slow and unstable for really large files because it reads the whole file into memory when you view a log file. I'm wanting to write a new log file viewer that addresses this problem.

What are the best practices for writing viewers for large text files? How does editors like notepad++ and VIM acomplish this? I was thinking of using a buffered Bi-directional text stream reader together with Java's TableModel. Am I thinking along the right lines and are such stream implementations available for Java?

© Stack Overflow or respective owner

Related posts about best-practices

Related posts about java