b64os = new Base64.OutputStream(baos, ENCODE | options); gzos = new java.util.zip.GZIPOutputStream(b64os); b64os.close(); } catch (final Exception e) {
/** * Flushes and closes (I think, in the superclass) the stream. * * @since 1.3 */ @Override public void close() throws java.io.IOException { // 1. Ensure that pending characters are written flushBase64(); // 2. Actually close the stream // Base class both flushes and closes. super.close(); buffer = null; out = null; }
/** * Calls {@link #write(int)} repeatedly until <var>len</var> bytes are written. * * @param theBytes array from which to read bytes * @param off offset for array * @param len max number of bytes to read into array * @since 1.3 */ @Override public void write(final byte[] theBytes, final int off, final int len) throws java.io.IOException { // Encoding suspended? if (suspendEncoding) { this.out.write(theBytes, off, len); return; } // end if: supsended for (int i = 0; i < len; i++) { write(theBytes[off + i]); } // end for: each byte written } // end write
b64os = new Base64.OutputStream(baos, ENCODE | options); gzos = new java.util.zip.GZIPOutputStream(b64os); b64os.close(); } catch (final Exception e) {
b64os = new Base64.OutputStream(baos, ENCODE | options); if ((options & GZIP) != 0) {
b64os = new Base64.OutputStream(baos, ENCODE | options); if ((options & GZIP) != 0) {
/** * Calls {@link #write(int)} repeatedly until <var>len</var> bytes are written. * * @param theBytes array from which to read bytes * @param off offset for array * @param len max number of bytes to read into array * @since 1.3 */ @Override public void write(final byte[] theBytes, final int off, final int len) throws java.io.IOException { // Encoding suspended? if (suspendEncoding) { this.out.write(theBytes, off, len); return; } // end if: supsended for (int i = 0; i < len; i++) { write(theBytes[off + i]); } // end for: each byte written } // end write
/** * Flushes and closes (I think, in the superclass) the stream. * * @since 1.3 */ @Override public void close() throws java.io.IOException { // 1. Ensure that pending characters are written flushBase64(); // 2. Actually close the stream // Base class both flushes and closes. super.close(); buffer = null; out = null; }
/** * Suspends encoding of the stream. 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 */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; }
/** * Suspends encoding of the stream. 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 */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; }