java-io Questions
1
Solved
So, basically I want to create a temporary file from a base64 string content. Right now, I'm doing this with native java-io functions. But I would like to achieve the same result using the rapture-...
Cocci asked 3/11, 2014 at 15:46
3
Solved
I have the following socket server in java,
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
i...
3
Solved
Let's say I have a very large TIFF image as input. I am not able to load this image entirely because of memory specification I must comply with. So the following is not an option :
BufferedImage d...
4
Solved
I use the following code:
final File newFile = new File("/mnt/sdcard/test/");
newFile.mkdir(); // if I use mkdirs() result is the same
And it creates an empty file! Why?
1
Solved
After reading this answer from @Peter Lawrey and especially this sentence :
close() can ensure the file is actually written to disk (or not depending on the OS)
(emphasis is mine.)
I have 3 ...
Crisp asked 18/9, 2014 at 10:27
3
Solved
I'm facing a little weird situation.
I'm copying from FileInputStream to FileOutputStream a file that is sized around 500MB.
It goes pretty well (takes around 500ms). When I close this FileOutputS...
2
Solved
hi i just started learning android development and i'm trying to build an app that reads text from files.
i have been searching all over the internet but i don't seem to find the way to do so...
1
Solved
All stream and bufferedReader need to be closed my question is what if
the stream and bufferedReader is inside a method arguments/parameters
need to be closed also?
example normal code:
InputStr...
3
Solved
I've got a RandomAccessFile in Java where i manage some data. Simplified:
At the start of the file i have an index. (8 byte long value per dataset which represents the offset where the real data ca...
1
8
Solved
I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3.
Recently under load, I ran out of memory in my VM and it was after I added the code...
2
I wanted to send a part of file to server where it will be printed on server screen...however dos reads entire input...kindly suggest what i can do....is there any other way to read stream from soc...
3
Solved
I am editing an XML file in Java with a Transformer by adding more nodes. The old XML code is unchanged but the new XML nodes have &lt; and &gt; instead of <> and are on the same line. H...
1
This question is related to thread Address Book Functionality which was closed considering being too broad.
I was developing a small test application using Random Access File. I am attaching the s...
4
Solved
I am using BufferedReader.readLine() method to read a response from a remote server (which is written in C and I have no access to source code).
BufferedReader br = new BufferedReader(new InputStr...
Worldshaking asked 26/5, 2011 at 14:2
3
Solved
I need to add text to beggining of text file via Java.
For example I have test.txt file with data:
Peter
John
Alice
I need to add(to top of file):
Jennifer
It should be:
Jennifer
Pet...
3
Solved
I would like to create a HTML file for my report. The content in the report can be created either by using BufferedWriter#write(String)
File f = new File("source.htm");
BufferedWriter bw = new Bu...
Byline asked 3/12, 2013 at 13:3
2
Solved
I try files writer as follows:
String content = "Test File Content";
I used as like : Files.write(path, content.getBytes(), StandardOpenOption.CREATE);
If file is not create, file is created...
4
Solved
I am trying to read a java file and modify it simultaneously. This is what I need to do : My file is of the format :
aaa
bbb
aaa
ccc
ddd
ddd
I need to read through the file and get the count of ...
3
Solved
Hi I'm new to Java and I would like to know what is the best choice to read a user Input in the console, as far as I know there are 3 ways to do it:
Console console = System.console();
BufferedRe...
5
Solved
This may be a silly one, but I want to know the background operation difference.
InputStream is = new FileInputStream(filepath);
FileInputStream is = new FileInputStream(filepath);
What is the ...
Oe asked 8/7, 2013 at 16:42
5
Solved
1) How does buffered streams work in background, how do they differ from normal streams and what are the advantage(s) of using them?
2) DataInputStream is also Byte based. But it is having methods...
Twicetold asked 12/11, 2009 at 10:45
2
Solved
Does File.deleteOnExit() guarantee that the file is deleted even if the JVM is killed prematurely?
2
Solved
I am trying to read from the logcat output in my app. I am able to read in correctly, but it goes on reading it in endless loop. Somehow there seems no way to detect the end of stream.
Not sure wh...
2
Consider :
public static void read(String filename) throws IOException {
String charsetName = "UTF-8";
InputStream file = new FileInputStream(filename); // say no problem
InputSt...
Coalfield asked 3/5, 2013 at 16:32
© 2022 - 2024 — McMap. All rights reserved.