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...
Gintz asked 20/10, 2014 at 16:11

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...
Julee asked 1/10, 2014 at 10:16

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?
Procrustes asked 19/12, 2012 at 13:44

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...
Bloodstock asked 14/8, 2014 at 12:59

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...
Gammer asked 18/6, 2014 at 17:31

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...
Caroncarotene asked 29/5, 2014 at 3:17

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...
Xhosa asked 10/10, 2011 at 8:43

1

Hi, I wanted to return a file from a resteasy server. For this purpose, I have a link at the client side which is calling a rest service with ajax. I want to return the file in the rest service. I ...
Saleable asked 16/11, 2011 at 7:9

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...
Pearlene asked 11/9, 2008 at 2:40

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...
Mroz asked 21/3, 2013 at 15:28

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 < and > instead of <> and are on the same line. H...
Crumble asked 24/6, 2013 at 17:1

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...
Binoculars asked 4/2, 2014 at 18:53

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...
Viaduct asked 21/5, 2013 at 8:11

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...
Precarious asked 5/11, 2013 at 16:38

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 ...
Fibula asked 22/11, 2010 at 22:57

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...
Centro asked 14/7, 2013 at 6:16

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?
Fireback asked 15/9, 2009 at 1:51

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...
Dalenedalenna asked 19/9, 2011 at 15:37

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.