aspose file tools*
The moose likes Beginning Java and the fly likes I/O stream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I/O stream " Watch "I/O stream " New topic
Author

I/O stream

Preet Dhillon
Greenhorn

Joined: May 20, 2008
Posts: 24

In the code above - I am trying to replace the Arrays.asList parameters to a text file





What method of file I/O stream should I be using for this purpose. Aslo, can it return a List<String> stooges from this method?

Thank you!
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3967
    
  17

There is no single method that you can can use to read a bunch of values from a file and turn them into a List<String>. You will have to go through the process of reading the lines, parsing the values and putting the values into the List. See the IO tutorial for help. Depending on the actual format of the file, parsing may not be as simple as it appears, so using a library which knows how to parse the format might help. For some example libraries that could be useful see our AccessingFileFormats (<= link) FAQ.


Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I/O stream
 
Similar Threads
What is the List class
ClassCastException
String array to arraylist
why the list size is 1
Output???