Top "Java-io" questions

The java.

Alternative to File.exists() in Java

I never thought it would happen to me, but I ran into my first bug in Java: http://bugs.sun.…

java file-io java-io nfs java-nio
Java File.exists() versus File.isFile()

I'm unable to think of a realistic use case for the method java.io.File.exists() or its equivalent in …

java java-io java.nio.file
InputStream or Reader wrapper for progress reporting

So, I'm feeding file data to an API that takes a Reader, and I'd like a way to report progress. …

java inputstream java-io
Sonar: How to use try-with-resources to close FileOutputStream

Sonar is giving an error that this FileOutputStream should be closed. I need to modify the following code to use …

java sonarqube java-io try-with-resources
Why cant a RandomAccessFile be casted to Inputstream?

I get compilation error when I do this cast: RandomAccessFile raf = new RandomAccessFile(...) InputStream is = (InputStream)raf; RandomAccessFile is supposed …

java java-io
Read lines of characters and get file position

I'm reading sequential lines of characters from a text file. The encoding of the characters in the file might not …

java nio java-io
Java: opening and reading from a file without locking it

I need to be able to mimic 'tail -f' with Java. I'm trying to read a log file as it's …

java filelock java-io
Resource leak: 'in' is never closed, though it IS closed

I know that there are a couple of similarly entitled questions out there, but most of them have simply forgotten …

java java-io
BlueJ and Input from keyboard

i have written the following code: import java.io.*; public class Typer { public static void main(String[] args) { Console cons; …

java input console java-io bluej
java.io.FileNotFoundException on an existing file

I am getting this error when I try to open a file: java.io.FileNotFoundException: D:\Portable%20Programs\Android%20Development\…

java filenotfoundexception java-io