@Override public void close() throws IOException { if (isOpen()) { try { sink.eof(); } finally { closed = true; } } }