java-io Questions

4

Solved

I was to trying to find the best way to pipe the InputStream to OutputStream. I don't have an option to use any other libraries like Apache IO. Here is the snippet and output. import java.io...
Enfeoff asked 30/7, 2012 at 5:43

5

Solved

The commons FileUtils look pretty cool, and I can't believe that they cannot be made to append to a file. File file = new File(path); FileUtils.writeLines(file, printStats(new DateTime(), headerRe...
Jene asked 27/10, 2009 at 9:46

7

Solved

For example, I want to zip a file stored in /Users/me/Desktop/image.jpg I made this method: public static Boolean generateZipFile(ArrayList<String> sourcesFilenames, String destinationDir, ...
Inequity asked 10/6, 2010 at 21:15

4

Solved

The Android Developer reference (this page) says: Throws FileNotFoundException But at the very start, it says: Open a private file associated with this Context's application package for writi...
Frow asked 23/11, 2013 at 12:44

3

Solved

I have a batch process running under java JDK 1.7. It is running on a system with RHEL, 2.6.18-308.el5 #1 SMP. This process gets a list of metadata objects from a database. From this metadata it e...
Manganite asked 6/1, 2016 at 22:37

6

Solved

To send data to a file on my FTP server, I need to create a custom InputStream implementation that reads database data row by row, converts it to CSV and publishes it via its read() methods: from t...
Styracaceous asked 26/1, 2011 at 13:40

3

Solved

I am using Android-Universal-Image-Loader to load images from remote server over HTTPS on my Android application. To have access to images the client should provide a valid token and sometimes serv...
Surefire asked 14/12, 2015 at 10:14

6

Solved

I want to counter the lines of the file and in the second pass i want to take every single line and manipulating it. It doesn't have a compilation error but it can't go inside the second while ((li...
Conlon asked 4/12, 2015 at 10:45

3

Solved

I have a file which has characters like: " Joh 1:1 ஆதியிலே வார்த்தை இருந்தது, அந்த வார்த்தை தேவனிடத்திலிருந்தது, அந்த வார்த்தை தேவனாயிருந்தது. " www.unicode.org/charts/PDF/U0B80.pdf‎ When I use t...
Tsana asked 1/8, 2013 at 3:56

2

Solved

I'm a student practicing my File IO skills and I am coming up against a problem with reading Objects from a file using ObjectInputStream. The code is consistently throwing an InvalidClassException ...
Felske asked 9/11, 2015 at 23:33

1

Solved

I'm trying to have my Java application read all the data in a given path. So files, directories, metadata etc. This also includes one weird thing NTFS has called Alternate Data Stream (ADS). Appar...
Geese asked 12/10, 2015 at 15:50

4

Solved

What are the differences (if any) between the following two buffering approaches? Reader r1 = new BufferedReader(new InputStreamReader(in, "UTF-8"), bufferSize); Reader r2 = new InputStreamReader(...
Arrowhead asked 11/8, 2010 at 14:4

2

Solved

While writing answers around SO, a user tried pointing out that java.io.File should not be used in new code, instead he argues that the the new object java.nio.Files should be used instead; he link...
Bigwig asked 21/8, 2015 at 15:0

6

Solved

I never thought it would happen to me, but I ran into my first bug in Java: https://bugs.java.com/bugdatabase/view_bug?bug_id=5003595 I'm pretty much in the same exact situation as described in the...
Noll asked 30/9, 2010 at 17:17

3

Solved

What is the sense of buffer size in the constructor? BufferedReader(Reader in, int size) As i have written the program: import java.io.*; class bufferedReaderEx{ public static void main(String...
Spoofery asked 9/1, 2011 at 11:54

6

Solved

I know that there are a couple of similarly entitled questions out there, but most of them have simply forgotten to put a close() directive on their stream. This here is different. Lets say I have...
Gummous asked 10/1, 2013 at 10:27

3

I'm running Java 1.5 on Solaris 10. My program is a standalone java program, using java concurrency package and log4j-1.2.12.jar to log certain information. primary logic is as below ExecutorServ...
Filipe asked 27/9, 2011 at 20:46

3

Solved

I'm looking for a way to get all the names of directories in a given directory, but not files. For example, let's say I have a folder called Parent, and inside that I have 3 folders: Child1 Child2...
Assail asked 23/11, 2012 at 17:24

7

According to the Java api documentation, the read() method that is declared in InputStream is described as: If no byte is available because the end of the stream has been reached, the value -1 is ...
Upraise asked 4/3, 2009 at 18:6

2

Solved

I have to read a file which can be local or in remote. The file path or URI will come form user input. Currently I am reading only local file,this way public String readFile(String fileName) { F...
Mossberg asked 3/5, 2015 at 17:10

1

Solved

I'm wondering why you still can read bytes from already closed ByteArrayOutputStream. Doesn't this line from docs mean the opposite? public void close (): Closes this stream. This releases syste...
Hilmahilt asked 22/4, 2015 at 8:31

1

Solved

My co-workers and I are having an argument about how the File.delete() method works in Java. In our code: File outFile = new File("/dir/name.ext"); if(outFile.exists()) outFile.delete(); FileI...
Divider asked 3/4, 2015 at 17:40

1

Because of a known (fixed) bug in Hazelcast 2.5 we've decided this would be the next upgrade candidate for our project. But after dropping in the latest version (3.2.2) we had horrible performance....
Unanswerable asked 17/6, 2014 at 10:11

2

Solved

In the book I'm reading on Java, it demonstrates serialization by using a program that writes to a file and stores it away. I'm getting a strange error that I don't know how to read and it denies m...
Anarchy asked 10/4, 2013 at 1:19

5

Solved

I ran namenode -format.This is my output. I tried changing the file permissions chmod 777 hadoop. I believe this line is the error ERROR namenode.NameNode: java.io.IOException: Cannot create dir...
Distrust asked 3/7, 2012 at 16:24

© 2022 - 2024 — McMap. All rights reserved.