All Questions
7 questions
1
vote
1
answer
1k
views
Read and sort 100 numbers from a text file
The program itself reads 100 values from a text file named input.txt. Then sorts those values in ascending order and writes the values to a new file called ...
4
votes
2
answers
239
views
Reader for graph-file with ugly return and questionable use of streams
I wrote a class that contains a static method that reads in files from NetworkRepository and converts them into a list of integer-arrays, each representing an edge. The file format from ...
0
votes
3
answers
103
views
Processing an InputStream and writing to an OuputStream, and ensuring that both streams get closed
Is it a bad thing to do multiple file closings in single finally block?
Relevant excerpt:
...
5
votes
1
answer
285
views
Transferring data from one file stream to another
I am currently reading Clean Code and for fun and profit, I intended to refactor some of the Java Tutorials and since I wanted to improve my Exception handling, the Byte Stream one with its lots of ...
4
votes
2
answers
264
views
Property file loader
I have the following code:
...
5
votes
2
answers
16k
views
IO and Scanner exception handling
I have created a sample file reading program as an exercise while learning how to implement good exception handling. I want to ask: is this a good approach or is there some other solution that I am ...
6
votes
5
answers
9k
views
Java Stream Exception Handling
I find this piece of Java code really ugly and cumbersome. How can I refactor it to be more clean and easier to read?
...