| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.7.0_251) on Sat May 02 18:30:01 PDT 2020 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Base64 (Trafodion Database Connectivity Services 2.4.0 API)</title> |
| <meta name="date" content="2020-05-02"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Base64 (Trafodion Database Connectivity Services 2.4.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Base64.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../org/trafodion/dcs/util/Base64.Base64InputStream.html" title="class in org.trafodion.dcs.util"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/trafodion/dcs/util/Base64.html" target="_top">Frames</a></li> |
| <li><a href="Base64.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested_class_summary">Nested</a> | </li> |
| <li><a href="#field_summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field_detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.trafodion.dcs.util</div> |
| <h2 title="Class Base64" class="title">Class Base64</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.trafodion.dcs.util.Base64</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public class <span class="strong">Base64</span> |
| extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">Encodes and decodes to and from Base64 notation. |
| |
| <p> |
| Homepage: <a href="http://iharder.net/base64">http://iharder.net/base64</a>. |
| </p> |
| |
| <p> |
| Change Log: |
| </p> |
| <ul> |
| <li>v2.2.1 - Fixed bug using URL_SAFE and ORDERED encodings. Fixed bug |
| when using very small files (~< 40 bytes).</li> |
| <li>v2.2 - Added some helper methods for encoding/decoding directly from |
| one file to the next. Also added a main() method to support command |
| line encoding/decoding from one file to the next. Also added these |
| Base64 dialects: |
| <ol> |
| <li>The default is RFC3548 format.</li> |
| <li>Using Base64.URLSAFE generates URL and file name friendly format as |
| described in Section 4 of RFC3548. |
| http://www.faqs.org/rfcs/rfc3548.html</li> |
| <li>Using Base64.ORDERED generates URL and file name friendly format |
| that preserves lexical ordering as described in |
| http://www.faqs.org/qa/rfcc-1940.html</li> |
| </ol> |
| <p> |
| Special thanks to Jim Kellerman at <a href="http://www.powerset.com/"> |
| http://www.powerset.com/</a> for contributing the new Base64 dialects. |
| </li> |
| |
| <li>v2.1 - Cleaned up javadoc comments and unused variables and methods. |
| Added some convenience methods for reading and writing to and from files. |
| </li> |
| <li>v2.0.2 - Now specifies UTF-8 encoding in places where the code fails on |
| systems with other encodings (like EBCDIC).</li> |
| <li>v2.0.1 - Fixed an error when decoding a single byte, that is, when the |
| encoded data was a single byte.</li> |
| <li>v2.0 - I got rid of methods that used booleans to set options. Now |
| everything is more consolidated and cleaner. The code now detects when |
| data that's being decoded is gzip-compressed and will decompress it |
| automatically. Generally things are cleaner. You'll probably have to |
| change some method calls that you were making to support the new options |
| format (<tt>int</tt>s that you "OR" together).</li> |
| <li>v1.5.1 - Fixed bug when decompressing and decoding to a byte[] using |
| <tt>decode( String s, boolean gzipCompressed )</tt>. Added the ability to |
| "suspend" encoding in the Output Stream so you can turn on and off the |
| encoding if you need to embed base64 data in an otherwise "normal" stream |
| (like an XML file).</li> |
| <li>v1.5 - Output stream pases on flush() command but doesn't do anything |
| itself. This helps when using GZIP streams. Added the ability to |
| GZip-compress objects before encoding them.</li> |
| <li>v1.4 - Added helper methods to read/write files.</li> |
| <li>v1.3.6 - Fixed OutputStream.flush() so that 'position' is reset.</li> |
| <li>v1.3.5 - Added flag to turn on and off line breaks. Fixed bug in input |
| stream where last buffer being read, if not completely full, was not |
| returned.</li> |
| <li>v1.3.4 - Fixed when "improperly padded stream" error was thrown at the |
| wrong time.</li> |
| <li>v1.3.3 - Fixed I/O streams which were totally messed up.</li> |
| </ul> |
| |
| <p> |
| I am placing this code in the Public Domain. Do with it as you will. This |
| software comes with no guarantees or warranties but with plenty of |
| well-wishing instead! |
| <p> |
| Please visit <a href="http://iharder.net/base64">http://iharder.net/base64</a> |
| periodically to check for updates or to contribute improvements. |
| <p> |
| author: Robert Harder, rob@iharder.net |
| <br> |
| version: 2.2.1</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_class_summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.Base64InputStream.html" title="class in org.trafodion.dcs.util">Base64.Base64InputStream</a></strong></code> |
| <div class="block">A <a href="../../../../org/trafodion/dcs/util/Base64.Base64InputStream.html" title="class in org.trafodion.dcs.util"><code>Base64.Base64InputStream</code></a> will read data from another |
| <tt>InputStream</tt>, given in the constructor, and |
| encode/decode to/from Base64 notation on the fly.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.Base64OutputStream.html" title="class in org.trafodion.dcs.util">Base64.Base64OutputStream</a></strong></code> |
| <div class="block">A <a href="../../../../org/trafodion/dcs/util/Base64.Base64OutputStream.html" title="class in org.trafodion.dcs.util"><code>Base64.Base64OutputStream</code></a> will write data to another |
| <tt>OutputStream</tt>, given in the constructor, and |
| encode/decode to/from Base64 notation on the fly.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#DECODE">DECODE</a></strong></code> |
| <div class="block">Specify decoding.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#DONT_BREAK_LINES">DONT_BREAK_LINES</a></strong></code> |
| <div class="block">Don't break lines when encoding (violates strict Base64 specification)</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#ENCODE">ENCODE</a></strong></code> |
| <div class="block">Specify encoding.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#GZIP">GZIP</a></strong></code> |
| <div class="block">Specify that data should be gzip-compressed.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#NO_OPTIONS">NO_OPTIONS</a></strong></code> |
| <div class="block">No options specified.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#ORDERED">ORDERED</a></strong></code> |
| <div class="block">Encode using the special "ordered" dialect of Base64 described here: |
| <a href="http://www.faqs.org/qa/rfcc-1940.html"> |
| http://www.faqs.org/qa/rfcc-1940.html</a>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#URL_SAFE">URL_SAFE</a></strong></code> |
| <div class="block">Encode using Base64-like encoding that is URL and Filename safe as |
| described in Section 4 of RFC3548: |
| <a href="http://www.faqs.org/rfcs/rfc3548.html"> |
| http://www.faqs.org/rfcs/rfc3548.html</a>.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decode(byte[],%20int,%20int,%20int)">decode</a></strong>(byte[] source, |
| int off, |
| int len, |
| int options)</code> |
| <div class="block">Very low-level access to decoding ASCII characters in the form of a byte |
| array.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decode(java.lang.String)">decode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> s)</code> |
| <div class="block">Decodes data from Base64 notation, automatically detecting gzip-compressed |
| data and decompressing it.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decode(java.lang.String,%20int)">decode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> s, |
| int options)</code> |
| <div class="block">Decodes data from Base64 notation, automatically detecting gzip-compressed |
| data and decompressing it.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decode4to3(byte[],%20int,%20byte[],%20int,%20int)">decode4to3</a></strong>(byte[] source, |
| int srcOffset, |
| byte[] destination, |
| int destOffset, |
| int options)</code> |
| <div class="block">Decodes four bytes from array <var>source</var> and writes the resulting |
| bytes (up to three of them) to <var>destination</var>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decodeFileToFile(java.lang.String,%20java.lang.String)">decodeFileToFile</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> infile, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> outfile)</code> |
| <div class="block">Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decodeFromFile(java.lang.String)">decodeFromFile</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</code> |
| <div class="block">Convenience method for reading a base64-encoded file and decoding it.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decodeToFile(java.lang.String,%20java.lang.String)">decodeToFile</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> dataToDecode, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</code> |
| <div class="block">Convenience method for decoding data to a file.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#decodeToObject(java.lang.String)">decodeToObject</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodedObject)</code> |
| <div class="block">Attempts to decode Base64 data and deserialize a Java Object within.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encode3to4(byte[],%20byte[],%20int,%20int)">encode3to4</a></strong>(byte[] b4, |
| byte[] threeBytes, |
| int numSigBytes, |
| int options)</code> |
| <div class="block">Encodes up to the first three bytes of array <var>threeBytes</var> and |
| returns a four-byte array in Base64 notation.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encode3to4(byte[],%20int,%20int,%20byte[],%20int,%20int)">encode3to4</a></strong>(byte[] source, |
| int srcOffset, |
| int numSigBytes, |
| byte[] destination, |
| int destOffset, |
| int options)</code> |
| <div class="block">Encodes up to three bytes of the array <var>source</var> and writes the |
| resulting four Base64 bytes to <var>destination</var>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeBytes(byte[])">encodeBytes</a></strong>(byte[] source)</code> |
| <div class="block">Encodes a byte array into Base64 notation.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeBytes(byte[],%20int)">encodeBytes</a></strong>(byte[] source, |
| int options)</code> |
| <div class="block">Encodes a byte array into Base64 notation.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeBytes(byte[],%20int,%20int)">encodeBytes</a></strong>(byte[] source, |
| int off, |
| int len)</code> |
| <div class="block">Encodes a byte array into Base64 notation.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeBytes(byte[],%20int,%20int,%20int)">encodeBytes</a></strong>(byte[] source, |
| int off, |
| int len, |
| int options)</code> |
| <div class="block">Encodes a byte array into Base64 notation.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeFileToFile(java.lang.String,%20java.lang.String)">encodeFileToFile</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> infile, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> outfile)</code> |
| <div class="block">Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeFromFile(java.lang.String)">encodeFromFile</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</code> |
| <div class="block">Convenience method for reading a binary file and base64-encoding it.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeObject(java.io.Serializable)">encodeObject</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a> serializableObject)</code> |
| <div class="block">Serializes an object and returns the Base64-encoded version of that |
| serialized object.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeObject(java.io.Serializable,%20int)">encodeObject</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a> serializableObject, |
| int options)</code> |
| <div class="block">Serializes an object and returns the Base64-encoded version of that |
| serialized object.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#encodeToFile(byte[],%20java.lang.String)">encodeToFile</a></strong>(byte[] dataToEncode, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</code> |
| <div class="block">Convenience method for encoding data to a file.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#getAlphabet(int)">getAlphabet</a></strong>(int options)</code> |
| <div class="block">Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options |
| specified.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static byte[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#getDecodabet(int)">getDecodabet</a></strong>(int options)</code> |
| <div class="block">Returns one of the _SOMETHING_DECODABET byte arrays depending on the |
| options specified.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/trafodion/dcs/util/Base64.html#main(java.lang.String[])">main</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] args)</code> |
| <div class="block">Main program.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="NO_OPTIONS"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NO_OPTIONS</h4> |
| <pre>public static final int NO_OPTIONS</pre> |
| <div class="block">No options specified. Value is zero.</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.NO_OPTIONS">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| <a name="ENCODE"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>ENCODE</h4> |
| <pre>public static final int ENCODE</pre> |
| <div class="block">Specify encoding.</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.ENCODE">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| <a name="DECODE"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DECODE</h4> |
| <pre>public static final int DECODE</pre> |
| <div class="block">Specify decoding.</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.DECODE">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| <a name="GZIP"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>GZIP</h4> |
| <pre>public static final int GZIP</pre> |
| <div class="block">Specify that data should be gzip-compressed.</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.GZIP">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| <a name="DONT_BREAK_LINES"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DONT_BREAK_LINES</h4> |
| <pre>public static final int DONT_BREAK_LINES</pre> |
| <div class="block">Don't break lines when encoding (violates strict Base64 specification)</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.DONT_BREAK_LINES">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| <a name="URL_SAFE"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>URL_SAFE</h4> |
| <pre>public static final int URL_SAFE</pre> |
| <div class="block">Encode using Base64-like encoding that is URL and Filename safe as |
| described in Section 4 of RFC3548: |
| <a href="http://www.faqs.org/rfcs/rfc3548.html"> |
| http://www.faqs.org/rfcs/rfc3548.html</a>. |
| It is important to note that data encoded this way is <em>not</em> |
| officially valid Base64, or at the very least should not be called Base64 |
| without also specifying that is was encoded using the URL and |
| Filename safe dialect.</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.URL_SAFE">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| <a name="ORDERED"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ORDERED</h4> |
| <pre>public static final int ORDERED</pre> |
| <div class="block">Encode using the special "ordered" dialect of Base64 described here: |
| <a href="http://www.faqs.org/qa/rfcc-1940.html"> |
| http://www.faqs.org/qa/rfcc-1940.html</a>.</div> |
| <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.trafodion.dcs.util.Base64.ORDERED">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="getAlphabet(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAlphabet</h4> |
| <pre>protected static byte[] getAlphabet(int options)</pre> |
| <div class="block">Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options |
| specified. It's possible, though silly, to specify ORDERED and URLSAFE in |
| which case one of them will be picked, though there is no guarantee as to |
| which one will be picked.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>options</code> - URL_SAFE or ORDERED</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>alphabet array to use</dd></dl> |
| </li> |
| </ul> |
| <a name="getDecodabet(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDecodabet</h4> |
| <pre>protected static byte[] getDecodabet(int options)</pre> |
| <div class="block">Returns one of the _SOMETHING_DECODABET byte arrays depending on the |
| options specified. It's possible, though silly, to specify ORDERED and |
| URL_SAFE in which case one of them will be picked, though there is no |
| guarantee as to which one will be picked.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>options</code> - URL_SAFE or ORDERED</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>alphabet array to use</dd></dl> |
| </li> |
| </ul> |
| <a name="main(java.lang.String[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>main</h4> |
| <pre>public static void main(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] args)</pre> |
| <div class="block">Main program. Used for testing. |
| |
| Encodes or decodes two files from the command line</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>args</code> - command arguments</dd></dl> |
| </li> |
| </ul> |
| <a name="encode3to4(byte[], byte[], int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encode3to4</h4> |
| <pre>protected static byte[] encode3to4(byte[] b4, |
| byte[] threeBytes, |
| int numSigBytes, |
| int options)</pre> |
| <div class="block">Encodes up to the first three bytes of array <var>threeBytes</var> and |
| returns a four-byte array in Base64 notation. The actual number of |
| significant bytes in your array is given by <var>numSigBytes</var>. The |
| array <var>threeBytes</var> needs only be as big as <var>numSigBytes</var>. |
| Code can reuse a byte array by passing a four-byte array as <var>b4</var>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b4</code> - A reusable byte array to reduce array instantiation</dd><dd><code>threeBytes</code> - the array to convert</dd><dd><code>numSigBytes</code> - the number of significant bytes in your array</dd><dd><code>options</code> - options for get alphabet</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>four byte array in Base64 notation.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.5.1</dd></dl> |
| </li> |
| </ul> |
| <a name="encode3to4(byte[], int, int, byte[], int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encode3to4</h4> |
| <pre>protected static byte[] encode3to4(byte[] source, |
| int srcOffset, |
| int numSigBytes, |
| byte[] destination, |
| int destOffset, |
| int options)</pre> |
| <div class="block">Encodes up to three bytes of the array <var>source</var> and writes the |
| resulting four Base64 bytes to <var>destination</var>. The source and |
| destination arrays can be manipulated anywhere along their length by |
| specifying <var>srcOffset</var> and <var>destOffset</var>. This method |
| does not check to make sure your arrays are large enough to accomodate |
| <var>srcOffset</var> + 3 for the <var>source</var> array or |
| <var>destOffset</var> + 4 for the <var>destination</var> array. The |
| actual number of significant bytes in your array is given by |
| <var>numSigBytes</var>. |
| <p> |
| This is the lowest level of the encoding methods with all possible |
| parameters.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - the array to convert</dd><dd><code>srcOffset</code> - the index where conversion begins</dd><dd><code>numSigBytes</code> - the number of significant bytes in your array</dd><dd><code>destination</code> - the array to hold the conversion</dd><dd><code>destOffset</code> - the index where output will be put</dd><dd><code>options</code> - options for get alphabet</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the <var>destination</var> array</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.3</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeObject(java.io.Serializable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeObject</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeObject(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a> serializableObject)</pre> |
| <div class="block">Serializes an object and returns the Base64-encoded version of that |
| serialized object. If the object cannot be serialized or there is another |
| error, the method will return <tt>null</tt>. The object is not |
| GZip-compressed before being encoded.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serializableObject</code> - The object to encode</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>The Base64-encoded object</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.4</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeObject(java.io.Serializable, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeObject</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeObject(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a> serializableObject, |
| int options)</pre> |
| <div class="block">Serializes an object and returns the Base64-encoded version of that |
| serialized object. If the object cannot be serialized or there is another |
| error, the method will return <tt>null</tt>. |
| <p> |
| Valid options: |
| <ul> |
| <li>GZIP: gzip-compresses object before encoding it.</li> |
| <li>DONT_BREAK_LINES: don't break lines at 76 characters. <i>Note: |
| Technically, this makes your encoding non-compliant.</i></li> |
| </ul> |
| <p> |
| Example: <code>encodeObject( myObj, Base64.GZIP )</code> or |
| <p> |
| Example: |
| <code>encodeObject( myObj, Base64.GZIP | Base64.DONT_BREAK_LINES )</code></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serializableObject</code> - The object to encode</dd><dd><code>options</code> - Specified options</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>The Base64-encoded object</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.0</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/trafodion/dcs/util/Base64.html#GZIP"><code>GZIP</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#DONT_BREAK_LINES"><code>DONT_BREAK_LINES</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="encodeBytes(byte[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeBytes</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeBytes(byte[] source)</pre> |
| <div class="block">Encodes a byte array into Base64 notation. Does not GZip-compress data.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - The data to convert</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>encoded byte array</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.4</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeBytes(byte[], int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeBytes</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeBytes(byte[] source, |
| int options)</pre> |
| <div class="block">Encodes a byte array into Base64 notation. |
| <p> |
| Valid options: |
| <ul> |
| <li>GZIP: gzip-compresses object before encoding it.</li> |
| <li>DONT_BREAK_LINES: don't break lines at 76 characters. <i>Note: |
| Technically, this makes your encoding non-compliant.</i></li> |
| </ul> |
| |
| <p> |
| Example: <code>encodeBytes( myData, Base64.GZIP )</code> or |
| <p> |
| Example: |
| <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - The data to convert</dd><dd><code>options</code> - Specified options</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>encoded byte array</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.0</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/trafodion/dcs/util/Base64.html#GZIP"><code>GZIP</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#DONT_BREAK_LINES"><code>DONT_BREAK_LINES</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#URL_SAFE"><code>URL_SAFE</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#ORDERED"><code>ORDERED</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="encodeBytes(byte[], int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeBytes</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeBytes(byte[] source, |
| int off, |
| int len)</pre> |
| <div class="block">Encodes a byte array into Base64 notation. Does not GZip-compress data.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - The data to convert</dd><dd><code>off</code> - Offset in array where conversion should begin</dd><dd><code>len</code> - Length of data to convert</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>encoded byte array</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.4</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeBytes(byte[], int, int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeBytes</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeBytes(byte[] source, |
| int off, |
| int len, |
| int options)</pre> |
| <div class="block">Encodes a byte array into Base64 notation. |
| <p> |
| Valid options: |
| <ul> |
| <li>GZIP: gzip-compresses object before encoding it.</li> |
| <li>DONT_BREAK_LINES: don't break lines at 76 characters. <i>Note: |
| Technically, this makes your encoding non-compliant.</i></li> |
| </ul> |
| |
| <p> |
| Example: <code>encodeBytes( myData, Base64.GZIP )</code> or |
| <p> |
| Example: |
| <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - The data to convert</dd><dd><code>off</code> - Offset in array where conversion should begin</dd><dd><code>len</code> - Length of data to convert</dd><dd><code>options</code> - Specified options</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>encoded byte array</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.0</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/trafodion/dcs/util/Base64.html#GZIP"><code>GZIP</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#DONT_BREAK_LINES"><code>DONT_BREAK_LINES</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#URL_SAFE"><code>URL_SAFE</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#ORDERED"><code>ORDERED</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="decode4to3(byte[], int, byte[], int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decode4to3</h4> |
| <pre>protected static int decode4to3(byte[] source, |
| int srcOffset, |
| byte[] destination, |
| int destOffset, |
| int options)</pre> |
| <div class="block">Decodes four bytes from array <var>source</var> and writes the resulting |
| bytes (up to three of them) to <var>destination</var>. The source and |
| destination arrays can be manipulated anywhere along their length by |
| specifying <var>srcOffset</var> and <var>destOffset</var>. This method |
| does not check to make sure your arrays are large enough to accomodate |
| <var>srcOffset</var> + 4 for the <var>source</var> array or |
| <var>destOffset</var> + 3 for the <var>destination</var> array. This |
| method returns the actual number of bytes that were converted from the |
| Base64 encoding. |
| <p> |
| This is the lowest level of the decoding methods with all possible |
| parameters. |
| </p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - the array to convert</dd><dd><code>srcOffset</code> - the index where conversion begins</dd><dd><code>destination</code> - the array to hold the conversion</dd><dd><code>destOffset</code> - the index where output will be put</dd><dd><code>options</code> - options for getDecoabet</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the number of decoded bytes converted</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.3</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/trafodion/dcs/util/Base64.html#URL_SAFE"><code>URL_SAFE</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#ORDERED"><code>ORDERED</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="decode(byte[], int, int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decode</h4> |
| <pre>public static byte[] decode(byte[] source, |
| int off, |
| int len, |
| int options)</pre> |
| <div class="block">Very low-level access to decoding ASCII characters in the form of a byte |
| array. Does not support automatically gunzipping or any other "fancy" |
| features.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - The Base64 encoded data</dd><dd><code>off</code> - The offset of where to begin decoding</dd><dd><code>len</code> - The length of characters to decode</dd><dd><code>options</code> - options for getDecodabet</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>decoded data</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.3</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/trafodion/dcs/util/Base64.html#URL_SAFE"><code>URL_SAFE</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#ORDERED"><code>ORDERED</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="decode(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decode</h4> |
| <pre>public static byte[] decode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> s)</pre> |
| <div class="block">Decodes data from Base64 notation, automatically detecting gzip-compressed |
| data and decompressing it.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - the string to decode</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the decoded data</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.4</dd></dl> |
| </li> |
| </ul> |
| <a name="decode(java.lang.String, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decode</h4> |
| <pre>public static byte[] decode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> s, |
| int options)</pre> |
| <div class="block">Decodes data from Base64 notation, automatically detecting gzip-compressed |
| data and decompressing it.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - the string to decode</dd><dd><code>options</code> - options for decode</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the decoded data</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.4</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/trafodion/dcs/util/Base64.html#URL_SAFE"><code>URL_SAFE</code></a>, |
| <a href="../../../../org/trafodion/dcs/util/Base64.html#ORDERED"><code>ORDERED</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="decodeToObject(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decodeToObject</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> decodeToObject(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodedObject)</pre> |
| <div class="block">Attempts to decode Base64 data and deserialize a Java Object within. |
| Returns <tt>null</tt> if there was an error.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>encodedObject</code> - The Base64 data to decode</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>The decoded and deserialized object</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.5</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeToFile(byte[], java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeToFile</h4> |
| <pre>public static boolean encodeToFile(byte[] dataToEncode, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</pre> |
| <div class="block">Convenience method for encoding data to a file.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>dataToEncode</code> - byte array of data to encode in base64 form</dd><dd><code>filename</code> - Filename for saving encoded data</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><tt>true</tt> if successful, <tt>false</tt> otherwise</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.1</dd></dl> |
| </li> |
| </ul> |
| <a name="decodeToFile(java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decodeToFile</h4> |
| <pre>public static boolean decodeToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> dataToDecode, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</pre> |
| <div class="block">Convenience method for decoding data to a file.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>dataToDecode</code> - Base64-encoded data as a string</dd><dd><code>filename</code> - Filename for saving decoded data</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><tt>true</tt> if successful, <tt>false</tt> otherwise</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.1</dd></dl> |
| </li> |
| </ul> |
| <a name="decodeFromFile(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decodeFromFile</h4> |
| <pre>public static byte[] decodeFromFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</pre> |
| <div class="block">Convenience method for reading a base64-encoded file and decoding it.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - Filename for reading encoded data</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>decoded byte array or null if unsuccessful</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.1</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeFromFile(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeFromFile</h4> |
| <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encodeFromFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</pre> |
| <div class="block">Convenience method for reading a binary file and base64-encoding it.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - Filename for reading binary data</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>base64-encoded string or null if unsuccessful</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.1</dd></dl> |
| </li> |
| </ul> |
| <a name="encodeFileToFile(java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encodeFileToFile</h4> |
| <pre>public static void encodeFileToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> infile, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> outfile)</pre> |
| <div class="block">Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>infile</code> - Input file</dd><dd><code>outfile</code> - Output file</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.2</dd></dl> |
| </li> |
| </ul> |
| <a name="decodeFileToFile(java.lang.String, java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>decodeFileToFile</h4> |
| <pre>public static void decodeFileToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> infile, |
| <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> outfile)</pre> |
| <div class="block">Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>infile</code> - Input file</dd><dd><code>outfile</code> - Output file</dd><dt><span class="strong">Since:</span></dt> |
| <dd>2.2</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Base64.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../org/trafodion/dcs/util/Base64.Base64InputStream.html" title="class in org.trafodion.dcs.util"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/trafodion/dcs/util/Base64.html" target="_top">Frames</a></li> |
| <li><a href="Base64.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested_class_summary">Nested</a> | </li> |
| <li><a href="#field_summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field_detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2020. All rights reserved.</small></p> |
| </body> |
| </html> |