/** * Flushes and closes (I think, in the superclass) the stream. * * {@inheritDoc} * * @since 1.3 */ @Override public void close() throws IOException { // 1. Ensure that pending characters are written flushBase64(); // 2. Actually close the stream (Base class both flushes and closes) super.close(); // this.buffer = null; this.out = null; }
/** * Suspends encoding of the stream. * * <p>May be helpful if you need to embed a piece of base64-encoded data in a stream. * * @throws java.io.IOException if there's an error flushing * @since 1.5.1 */ public void suspendEncoding() throws IOException { flushBase64(); this.suspendEncoding = true; }