Top "Java-io" questions

The java.

How to check whether an OutputStream is closed

Is there anyway to check whether an OutputStream is closed without attempting to write to it and catching the IOException? …

java outputstream java-io
Reading a text file line by line in android

hi i just started learning android development and i'm trying to build an app that reads text from files. i …

java android java-io
How to use flush() for PrintWriter

I have some codes like this: PrintWriter pw = new PrintWriter(new BufferedReader(....)); for(int i=0; i<10; i++) { pw.println("…

java java-io
How to overwrite file via java nio writer?

I try files writer as follows: String content = "Test File Content"; I used as like : Files.write(path, content.getBytes(), …

java io nio java-io
InputStream, mark(), reset()

How are mark() and reset() methods working exactly(in code below), step by step ? I tried to write my own …

java java-io
Should I buffer the InputStream or the InputStreamReader?

What are the differences (if any) between the following two buffering approaches? Reader r1 = new BufferedReader(new InputStreamReader(in, "UTF-8"), …

java buffering java-io bufferedreader bufferedinputstream
Process Builder waitFor() issue and Open file limitations

I have inherited some code: Process p = new ProcessBuilder("/bin/chmod", "777", path).start(); p.waitFor(); Basically, there is for some …

java java-io processbuilder
Should I always wrap an InputStream as BufferedInputStream?

Does it make sense to always wrap an InputStream as BufferedInputStream, when I know whether the given InputStream is something …

java stream java-io
what is the difference in using InputStream instead of FileInputStream while creating the FileInputStream object

This may be a silly one, but I want to know the background operation difference. InputStream is = new FileInputStream(filepath); …

java file inputstream java-io fileinputstream
Converting transparent gif / png to jpeg using java

I'd like to convert gif images to jpeg using Java. It works great for most images, but I have a …

java transparency jpeg gif java-io