File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
library/src/main/java/bio/terra/pfb Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,8 @@ public static String showMetadata(String fileLocation) throws IOException {
49
49
50
50
public static List <String > show (String fileLocation ) throws IOException {
51
51
List <String > data = new ArrayList <>();
52
- try {
53
- DataFileStream <GenericRecord > records = PfbReader .getGenericRecordsStream (fileLocation );
54
52
53
+ try (DataFileStream <GenericRecord > records = PfbReader .getGenericRecordsStream (fileLocation )) {
55
54
while (records .hasNext ()) {
56
55
data .add (convertEnum (records .next ().toString ()));
57
56
}
@@ -61,6 +60,9 @@ public static List<String> show(String fileLocation) throws IOException {
61
60
}
62
61
}
63
62
63
+ /**
64
+ * DataFileStream implements Closeable and must be closed by the client code.
65
+ **/
64
66
public static DataFileStream <GenericRecord > getGenericRecordsStream (String fileLocation )
65
67
throws IOException {
66
68
GenericDatumReader <GenericRecord > datumReader = new GenericDatumReader <>();
You can’t perform that action at this time.
0 commit comments