@Override public void write(byte[] b, int off, int len) throws IOException { if (!isOpen()) { throw new IOException("write(len=" + len + ") Stream has been closed"); } sink.receive(b, off, len); }
@Override public void close() throws IOException { if (isOpen()) { try { sink.eof(); } finally { closed = true; } } }