Answer the question
In order to leave comments, you need to log in
How to properly close nested streams in Java?
I have this code:
try (final FSDataInputStream fileStream = getFileInputStream() {
Table table = csvUtils.getData(tableInfo, new BufferedReader(new InputStreamReader(fileStream)));
}
Answer the question
In order to leave comments, you need to log in
Why not do so?
try (BufferedReader reader = new BufferedReader(new InputStreamReader(getFileInputStream()))) {
Table table = csvUtils.getData(tableInfo, reader);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question