@Beta
public class StreamingSheetWriter extends SheetDataWriter {
private static final Logger LOG = LogManager.getLogger(StreamingSheetWriter.class);
+ private boolean closed = false;
public StreamingSheetWriter() throws IOException {
throw new RuntimeException("StreamingSheetWriter requires OutputStream");
@Override
public void close() throws IOException {
- _out.flush();
+ if (!closed) {
+ _out.flush();
+ }
}
@Override
@Override
boolean dispose() throws IOException {
- _out.close();
+ if (!closed) {
+ _out.close();
+ }
+ closed = true;
return true;
}
}