b64os = new Base64.OutputStream(baos, ENCODE | options); gzos = new java.util.zip.GZIPOutputStream(b64os);
bos = new Base64.OutputStream(new java.io.FileOutputStream(filename), Base64.ENCODE); bos.write(dataToEncode);
/** * 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; } // end close
b64os = new Base64.OutputStream(baos, ENCODE | options); gzos = new java.util.zip.GZIPOutputStream(b64os);
b64os = new Base64.OutputStream(baos, ENCODE | options); if ((options & GZIP) != 0) {
b64os = new Base64.OutputStream(baos, ENCODE | options); if ((options & GZIP) != 0) {
bufferStream.setMimeType(mimeType); bufferStream.setFileName(filename); Base64.OutputStream b64stream = new Base64.OutputStream(bufferStream, Base64.DECODE); for (int i = 0; i < len; i++) { b64stream.write(chars[offset + i]); b64stream.close(); bufferStream.destroy(null); throw new CmisInvalidArgumentException("Unexpected tag: " + parser.getName()); b64stream.close(); } catch (XMLStreamException xse) {
bos = new Base64.OutputStream(new java.io.FileOutputStream(filename), Base64.DECODE); bos.write(dataToDecode.getBytes(PREFERRED_ENCODING));
bos = new Base64.OutputStream(new java.io.FileOutputStream(filename), Base64.ENCODE); bos.write(dataToEncode);
bos = new Base64.OutputStream(new java.io.FileOutputStream(filename), Base64.DECODE); bos.write(dataToDecode.getBytes(PREFERRED_ENCODING));
/** * 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(byte[] theBytes, int off, 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
/** * 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(byte[] theBytes, int off, 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; } // end close
/** * 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 * @since 1.5.1 */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; } // end suspendEncoding
/** * 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 * @since 1.5.1 */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; } // end suspendEncoding