File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
example/src/main/java/example Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change 22
33import static java .nio .charset .StandardCharsets .UTF_8 ;
44
5- import java .io .BufferedInputStream ;
65import java .io .BufferedOutputStream ;
76import java .io .IOException ;
8- import java .io .InputStreamReader ;
7+ import java .io .InputStream ;
98import java .io .OutputStreamWriter ;
10- import java .io .Reader ;
119import java .nio .file .Files ;
1210import java .nio .file .Path ;
1311import java .util .zip .GZIPInputStream ;
@@ -51,10 +49,8 @@ private static void readCsvGzipped(final Path file) throws IOException {
5149 }
5250 }
5351
54- private static Reader gzipReader (final Path file ) throws IOException {
55- final var bufIn = new BufferedInputStream (Files .newInputStream (file ));
56- final var gzipIn = new GZIPInputStream (bufIn );
57- return new InputStreamReader (gzipIn , UTF_8 );
52+ private static InputStream gzipReader (final Path file ) throws IOException {
53+ return new GZIPInputStream (Files .newInputStream (file ));
5854 }
5955
6056}
Original file line number Diff line number Diff line change 22
33import java .io .FileNotFoundException ;
44import java .io .IOException ;
5- import java .io .InputStreamReader ;
6- import java .io .Reader ;
7- import java .nio .charset .StandardCharsets ;
5+ import java .io .InputStream ;
86
97import de .siegmar .fastcsv .reader .CsvReader ;
108import de .siegmar .fastcsv .reader .CsvRecord ;
@@ -18,12 +16,12 @@ public static void main(final String[] args) throws IOException {
1816 }
1917 }
2018
21- static Reader readFromClasspath (final String name ) throws FileNotFoundException {
19+ static InputStream readFromClasspath (final String name ) throws FileNotFoundException {
2220 final var in = ExampleCsvReaderWithClasspathInput .class .getResourceAsStream (name );
2321 if (in == null ) {
2422 throw new FileNotFoundException ("Resource not found on classpath: " + name );
2523 }
26- return new InputStreamReader ( in , StandardCharsets . UTF_8 ) ;
24+ return in ;
2725 }
2826
2927}
You can’t perform that action at this time.
0 commit comments