Skip to content

Commit e2622e5

Browse files
committed
Implement Closeable
1 parent 56b5d5e commit e2622e5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/fasterxml/sort/IteratingSorter.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.fasterxml.sort.util.SegmentedBuffer;
44

5+
import java.io.Closeable;
56
import java.io.File;
67
import java.io.IOException;
78
import java.util.ArrayList;
@@ -11,7 +12,7 @@
1112
import java.util.List;
1213
import java.util.NoSuchElementException;
1314

14-
public class IteratingSorter<T> extends SorterBase<T>
15+
public class IteratingSorter<T> extends SorterBase<T> implements Closeable
1516
{
1617
// Set iff sort spilled to disk
1718
private List<File> _mergerInputs;
@@ -110,6 +111,14 @@ public Iterator<T> sort(DataReader<T> inputReader)
110111
return iterator;
111112
}
112113

114+
115+
/*
116+
/**********************************************************************
117+
/* Closeable API
118+
/**********************************************************************
119+
*/
120+
121+
@Override
113122
public void close() {
114123
if (_merger != null) {
115124
try {

0 commit comments

Comments
 (0)