|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
java.io.OutputStream
com.tangosol.io.Base64OutputStream
public class Base64OutputStream
Writes binary data into a Writer using IETF RFC 2045 Base64 Content Transfer Encoding. If the Base64OutputStream is not the first to write data into the Writer, it may be desired to write a line feed before Base64 data. According to the specification, Base64 data cannot exceed 76 characters per line. Be careful to avoid calling flush() except when a stream of Base64 content is complete.
| Field Summary | |
|---|---|
protected static char[] |
BASE64_ALPHABETBase64 encodes into this "alphabet" of 64 characters. |
protected static char |
BASE64_LFThe Base64 line feed character. |
protected static char |
BASE64_PADThe Base64 padding character. |
protected static int |
GROUPS_PER_LINEThe number of Base64 character groups in one line. |
protected byte[] |
m_abAccumAccumulated bytes. |
protected char[] |
m_achGroupAn array that is used to send 4 characters at a time to the underlying Writer object. |
protected int |
m_cAccumThe number of bytes accumulated (0, 1, 2 or 3). |
protected int |
m_cLineGroupsThe number of groups left to write in the current line. |
protected boolean |
m_fBreakLinesTrue if lines are to be broken by BASE64_LF; |
protected boolean |
m_fClosedTrue after close is invoked. |
protected java.io.Writer |
m_writerThe Writer object to which the Base64 encoded data is written. |
| Constructor Summary | |
|---|---|
Base64OutputStream(java.io.Writer writer)Construct a Base64OutputStream on a Writer object. |
|
Base64OutputStream(java.io.Writer writer, boolean fBreakLines)Construct a Base64OutputStream on a Writer object and specifying a line-break option. |
|
| Method Summary | |
|---|---|
void |
close()Close the stream, flushing any accumulated bytes. |
static char[] |
encode(byte[] ab)Encode the passed binary data using Base64 encoding. |
static char[] |
encode(byte[] ab, boolean fBreakLines)Encode the passed binary data using Base64 encoding. |
static char[] |
encode(byte[] ab, int ofb, int cb, boolean fBreakLines)Encode the passed binary data using Base64 encoding. |
void |
flush()Close the stream, flushing any accumulated bytes. |
protected void |
flushAccumulator()Flushes the bytes accumulated by the write(int) method. |
void |
write(byte[] ab, int ofb, int cb)Writes len bytes from the specified byte array starting at offset off to this output stream. |
void |
write(int b)Writes the specified byte to this output stream. |
| Methods inherited from class java.io.OutputStream |
|---|
write |
| Methods inherited from interface com.tangosol.io.OutputStreaming |
|---|
write |
| Field Detail |
|---|
protected static final char[] BASE64_ALPHABET
protected static final char BASE64_PAD
protected static final char BASE64_LF
protected static final int GROUPS_PER_LINE
protected boolean m_fClosed
protected java.io.Writer m_writer
protected boolean m_fBreakLines
protected int m_cLineGroups
protected byte[] m_abAccum
protected int m_cAccum
protected char[] m_achGroup
| Constructor Detail |
|---|
public Base64OutputStream(java.io.Writer writer)
writer - the Writer to write the Base64 encoded data to
public Base64OutputStream(java.io.Writer writer,
boolean fBreakLines)
writer - the Writer to write the Base64 encoded data tofBreakLines - true to break the output into 76-character lines| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in interface OutputStreamingwrite in class java.io.OutputStreamb - the byte.java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
public void write(byte[] ab,
int ofb,
int cb)
throws java.io.IOException
len bytes from the specified byte array starting at offset off to this output stream.
If b is null, a NullPointerException is thrown.
If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.
write in interface OutputStreamingwrite in class java.io.OutputStreamab - the dataofb - the start offset in the datacb - the number of bytes to writejava.io.IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
public void flush()
throws java.io.IOException
flush in interface OutputStreamingflush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - if an I/O error occurs
public void close()
throws java.io.IOException
close in interface OutputStreamingclose in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException - if an I/O error occurs
protected void flushAccumulator()
throws java.io.IOException
java.io.IOException - if an I/O error occurspublic static char[] encode(byte[] ab)
ab - the array containing the bytes to encode
public static char[] encode(byte[] ab,
boolean fBreakLines)
ab - the array containing the bytes to encodefBreakLines - true to break the output into 76-character lines
public static char[] encode(byte[] ab,
int ofb,
int cb,
boolean fBreakLines)
ab - the array containing the bytes to encodeofb - the start offset in the byte arraycb - the number of bytes to encodefBreakLines - true to break the output into 76-character lines
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||