blob: 934e8011d3aa888bcfee15e5e6581986f8c007c2 [file] [log] [blame]
<!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 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Base64 (Apache Calcite Avatica API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Base64 (Apache Calcite Avatica API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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><a href="../../../../../org/apache/calcite/avatica/util/ArrayIteratorCursor.html" title="class in org.apache.calcite.avatica.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/calcite/avatica/util/Base64.InputStream.html" title="class in org.apache.calcite.avatica.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/calcite/avatica/util/Base64.html" target="_top">Frames</a></li>
<li><a href="Base64.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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.apache.calcite.avatica.util</div>
<h2 title="Class Base64" class="title">Class Base64</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/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.apache.calcite.avatica.util.Base64</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">Base64</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><p>Encodes and decodes to and from Base64 notation.</p>
<p>Homepage: <a href="http://iharder.net/base64">http://iharder.net/base64</a>.</p>
<p>Example:</p>
<code>String encoded = Base64.encode( myByteArray );</code>
<br>
<code>byte[] myByteArray = Base64.decode( encoded );</code>
<p>The <code>options</code> parameter, which appears in a few places, is used to pass
several pieces of information to the encoder. In the "higher level" methods such as
encodeBytes( bytes, options ) the options parameter can be used to indicate such
things as first gzipping the bytes before encoding them, not inserting linefeeds,
and encoding using the URL-safe and Ordered dialects.</p>
<p>Note, according to <a href="http://www.faqs.org/rfcs/rfc3548.html">RFC3548</a>,
Section 2.1, implementations should not add line feeds unless explicitly told
to do so. I've got Base64 set to this behavior now, although earlier versions
broke lines by default.</p>
<p>The constants defined in Base64 can be OR-ed together to combine options, so you
might make a call like this:</p>
<code>String encoded = Base64.encodeBytes( mybytes, Base64.GZIP | Base64.DO_BREAK_LINES );</code>
<p>to compress the data before encoding it and then making the output have newline characters.</p>
<p>Also...</p>
<code>String encoded = Base64.encodeBytes( crazyString.getBytes() );</code>
<p>
Change Log:
</p>
<ul>
<li>v2.3.7 - Fixed subtle bug when base 64 input stream contained the
value 01111111, which is an invalid base 64 character but should not
throw an ArrayIndexOutOfBoundsException either. Led to discovery of
mishandling (or potential for better handling) of other bad input
characters. You should now get an IOException if you try decoding
something that has bad characters in it.</li>
<li>v2.3.6 - Fixed bug when breaking lines and the final byte of the encoded
string ended in the last column; the buffer was not properly shrunk and
contained an extra (null) byte that made it into the string.</li>
<li>v2.3.5 - Fixed bug in <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeFromFile-java.lang.String-"><code>encodeFromFile(java.lang.String)</code></a> where estimated buffer size
was wrong for files of size 31, 34, and 37 bytes.</li>
<li>v2.3.4 - Fixed bug when working with gzipped streams whereby flushing
the Base64.OutputStream closed the Base64 encoding (by padding with equals
signs) too soon. Also added an option to suppress the automatic decoding
of gzipped streams. Also added experimental support for specifying a
class loader when using the
<a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decodeToObject-java.lang.String-int-java.lang.ClassLoader-"><code>decodeToObject(java.lang.String, int, java.lang.ClassLoader)</code></a>
method.</li>
<li>v2.3.3 - Changed default char encoding to US-ASCII which reduces the internal Java
footprint with its CharEncoders and so forth. Fixed some javadocs that were
inconsistent. Removed imports and specified things like java.io.IOException
explicitly inline.</li>
<li>v2.3.2 - Reduced memory footprint! Finally refined the "guessing" of how big the
final encoded data will be so that the code doesn't have to create two output
arrays: an oversized initial one and then a final, exact-sized one. Big win
when using the <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytesToBytes-byte:A-"><code>encodeBytesToBytes(byte[])</code></a> family of methods (and not
using the gzip options which uses a different mechanism with streams and stuff).</li>
<li>v2.3.1 - Added <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytesToBytes-byte:A-int-int-int-"><code>encodeBytesToBytes(byte[], int, int, int)</code></a> and some
similar helper methods to be more efficient with memory by not returning a
String but just a byte array.</li>
<li>v2.3 - <strong>This is not a drop-in replacement!</strong> This is two years of comments
and bug fixes queued up and finally executed. Thanks to everyone who sent
me stuff, and I'm sorry I wasn't able to distribute your fixes to everyone else.
Much bad coding was cleaned up including throwing exceptions where necessary
instead of returning null values or something similar. Here are some changes
that may affect you:
<ul>
<li><em>Does not break lines, by default.</em> This is to keep in compliance with
<a href="http://www.faqs.org/rfcs/rfc3548.html">RFC3548</a>.</li>
<li><em>Throws exceptions instead of returning null values.</em> Because some operations
(especially those that may permit the GZIP option) use IO streams, there
is a possiblity of an java.io.IOException being thrown. After some discussion and
thought, I've changed the behavior of the methods to throw java.io.IOExceptions
rather than return null if ever there's an error. I think this is more
appropriate, though it will require some changes to your code. Sorry,
it should have been done this way to begin with.</li>
<li><em>Removed all references to System.out, System.err, and the like.</em>
Shame on me. All I can say is sorry they were ever there.</li>
<li><em>Throws NullPointerExceptions and IllegalArgumentExceptions</em> as needed
such as when passed arrays are null or offsets are invalid.</li>
<li>Cleaned up as much javadoc as I could to avoid any javadoc warnings.
This was especially annoying before for people who were thorough in their
own projects and then had gobs of javadoc warnings on this file.</li>
</ul>
<li>v2.2.1 - Fixed bug using URL_SAFE and ORDERED encodings. Fixed bug
when using very small files (~&lt; 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>Calling Base64.setFormat(Base64.BASE64_FORMAT.URLSAFE_FORMAT) generates
URL and file name friendly format as described in Section 4 of RFC3548.
http://www.faqs.org/rfcs/rfc3548.html</li>
<li>Calling Base64.setFormat(Base64.BASE64_FORMAT.ORDERED_FORMAT) generates
URL and file name friendly format that preserves lexical ordering as described
in http://www.faqs.org/qa/rfcc-1940.html</li>
</ol>
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 (<code>int</code>s that you "OR" together).</li>
<li>v1.5.1 - Fixed bug when decompressing and decoding to a
byte[] using <code>decode( String s, boolean gzipCompressed )</code>.
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!
Please visit <a href="http://iharder.net/base64">http://iharder.net/base64</a>
periodically to check for updates or to contribute improvements.
</p></div>
<dl>
<dt><span class="simpleTagLabel">Version:</span></dt>
<dd>2.3.7</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Robert Harder, rob@iharder.net</dd>
</dl>
</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="memberSummary" 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">&nbsp;</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&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.InputStream.html" title="class in org.apache.calcite.avatica.util">Base64.InputStream</a></span></code>
<div class="block">A <a href="../../../../../org/apache/calcite/avatica/util/Base64.InputStream.html" title="class in org.apache.calcite.avatica.util"><code>Base64.InputStream</code></a> will read data from another
<code>java.io.InputStream</code>, 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&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.OutputStream.html" title="class in org.apache.calcite.avatica.util">Base64.OutputStream</a></span></code>
<div class="block">A <a href="../../../../../org/apache/calcite/avatica/util/Base64.OutputStream.html" title="class in org.apache.calcite.avatica.util"><code>Base64.OutputStream</code></a> will write data to another
<code>java.io.OutputStream</code>, 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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</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><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DECODE">DECODE</a></span></code>
<div class="block">Specify decoding in first bit.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES">DO_BREAK_LINES</a></span></code>
<div class="block">Do break lines when encoding.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DONT_GUNZIP">DONT_GUNZIP</a></span></code>
<div class="block">Specify that gzipped data should <em>not</em> be automatically gunzipped.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#ENCODE">ENCODE</a></span></code>
<div class="block">Specify encoding in first bit.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP">GZIP</a></span></code>
<div class="block">Specify that data should be gzip-compressed in second bit.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#NO_OPTIONS">NO_OPTIONS</a></span></code>
<div class="block">No options specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#ORDERED">ORDERED</a></span></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="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#URL_SAFE">URL_SAFE</a></span></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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decode-byte:A-">decode</a></span>(byte[]&nbsp;source)</code>
<div class="block">Low-level access to decoding ASCII characters in
the form of a byte array.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decode-byte:A-int-int-int-">decode</a></span>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)</code>
<div class="block">Low-level access to decoding ASCII characters in
the form of a byte array.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decode-java.lang.String-">decode</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)</code>
<div class="block">Decodes data from Base64 notation, automatically
detecting gzip-compressed data and decompressing it.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decode-java.lang.String-int-">decode</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s,
int&nbsp;options)</code>
<div class="block">Decodes data from Base64 notation, automatically
detecting gzip-compressed data and decompressing it.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decodeFileToFile-java.lang.String-java.lang.String-">decodeFileToFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;infile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;outfile)</code>
<div class="block">Reads <code>infile</code> and decodes it to <code>outfile</code>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decodeFromFile-java.lang.String-">decodeFromFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Convenience method for reading a base64-encoded
file and decoding it.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decodeToFile-java.lang.String-java.lang.String-">decodeToFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dataToDecode,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Convenience method for decoding data to a file.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decodeToObject-java.lang.String-">decodeToObject</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodedObject)</code>
<div class="block">Attempts to decode Base64 data and deserialize a Java
Object within.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#decodeToObject-java.lang.String-int-java.lang.ClassLoader-">decodeToObject</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodedObject,
int&nbsp;options,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;loader)</code>
<div class="block">Attempts to decode Base64 data and deserialize a Java
Object within.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encode-java.nio.ByteBuffer-java.nio.ByteBuffer-">encode</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;raw,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;encoded)</code>
<div class="block">Performs Base64 encoding on the <code>raw</code> ByteBuffer,
writing it to the <code>encoded</code> ByteBuffer.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encode-java.nio.ByteBuffer-java.nio.CharBuffer-">encode</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;raw,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html?is-external=true" title="class or interface in java.nio">CharBuffer</a>&nbsp;encoded)</code>
<div class="block">Performs Base64 encoding on the <code>raw</code> ByteBuffer,
writing it to the <code>encoded</code> CharBuffer.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-">encodeBytes</a></span>(byte[]&nbsp;source)</code>
<div class="block">Encodes a byte array into Base64 notation.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-int-">encodeBytes</a></span>(byte[]&nbsp;source,
int&nbsp;options)</code>
<div class="block">Encodes a byte array into Base64 notation.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-int-int-">encodeBytes</a></span>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len)</code>
<div class="block">Encodes a byte array into Base64 notation.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-int-int-int-">encodeBytes</a></span>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)</code>
<div class="block">Encodes a byte array into Base64 notation.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytesToBytes-byte:A-">encodeBytesToBytes</a></span>(byte[]&nbsp;source)</code>
<div class="block">Similar to <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-"><code>encodeBytes(byte[])</code></a> but returns
a byte array instead of instantiating a String.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytesToBytes-byte:A-int-int-int-">encodeBytesToBytes</a></span>(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)</code>
<div class="block">Similar to <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-int-int-int-"><code>encodeBytes(byte[], int, int, int)</code></a> but returns
a byte array instead of instantiating a String.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeFileToFile-java.lang.String-java.lang.String-">encodeFileToFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;infile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;outfile)</code>
<div class="block">Reads <code>infile</code> and encodes it to <code>outfile</code>.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeFromFile-java.lang.String-">encodeFromFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Convenience method for reading a binary file
and base64-encoding it.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeObject-java.io.Serializable-">encodeObject</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;serializableObject)</code>
<div class="block">Serializes an object and returns the Base64-encoded
version of that serialized object.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeObject-java.io.Serializable-int-">encodeObject</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;serializableObject,
int&nbsp;options)</code>
<div class="block">Serializes an object and returns the Base64-encoded
version of that serialized object.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeToFile-byte:A-java.lang.String-">encodeToFile</a></span>(byte[]&nbsp;dataToEncode,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Convenience method for encoding data to a file.</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&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" 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&nbsp;int NO_OPTIONS</pre>
<div class="block">No options specified. Value is zero.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.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&nbsp;int ENCODE</pre>
<div class="block">Specify encoding in first bit. Value is one.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.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&nbsp;int DECODE</pre>
<div class="block">Specify decoding in first bit. Value is zero.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.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&nbsp;int GZIP</pre>
<div class="block">Specify that data should be gzip-compressed in second bit. Value is two.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.util.Base64.GZIP">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DONT_GUNZIP">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DONT_GUNZIP</h4>
<pre>public static final&nbsp;int DONT_GUNZIP</pre>
<div class="block">Specify that gzipped data should <em>not</em> be automatically gunzipped.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.util.Base64.DONT_GUNZIP">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DO_BREAK_LINES">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DO_BREAK_LINES</h4>
<pre>public static final&nbsp;int DO_BREAK_LINES</pre>
<div class="block">Do break lines when encoding. Value is 8.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.util.Base64.DO_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&nbsp;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="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.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&nbsp;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="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.avatica.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="encode-java.nio.ByteBuffer-java.nio.ByteBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public static&nbsp;void&nbsp;encode(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;raw,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;encoded)</pre>
<div class="block">Performs Base64 encoding on the <code>raw</code> ByteBuffer,
writing it to the <code>encoded</code> ByteBuffer.
This is an experimental feature. Currently it does not
pass along any options (such as <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES"><code>DO_BREAK_LINES</code></a>
or <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP"><code>GZIP</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>raw</code> - input buffer</dd>
<dd><code>encoded</code> - output buffer</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.3</dd>
</dl>
</li>
</ul>
<a name="encode-java.nio.ByteBuffer-java.nio.CharBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public static&nbsp;void&nbsp;encode(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;raw,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html?is-external=true" title="class or interface in java.nio">CharBuffer</a>&nbsp;encoded)</pre>
<div class="block">Performs Base64 encoding on the <code>raw</code> ByteBuffer,
writing it to the <code>encoded</code> CharBuffer.
This is an experimental feature. Currently it does not
pass along any options (such as <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES"><code>DO_BREAK_LINES</code></a>
or <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP"><code>GZIP</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>raw</code> - input buffer</dd>
<dd><code>encoded</code> - output buffer</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.3</dd>
</dl>
</li>
</ul>
<a name="encodeObject-java.io.Serializable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeObject</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeObject(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;serializableObject)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Serializes an object and returns the Base64-encoded
version of that serialized object.
<p>As of v 2.3, if the object
cannot be serialized or there is another error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned a null value, but
in retrospect that's a pretty poor way to handle it.</p>
The object is not GZip-compressed before being encoded.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serializableObject</code> - The object to encode</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if serializedObject is null</dd>
<dt><span class="simpleTagLabel">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&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeObject(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;serializableObject,
int&nbsp;options)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Serializes an object and returns the Base64-encoded
version of that serialized object.
<p>As of v 2.3, if the object
cannot be serialized or there is another error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned a null value, but
in retrospect that's a pretty poor way to handle it.</p>
The object is not GZip-compressed before being encoded.
<p>
Example options:<pre>
GZIP: gzip-compresses object before encoding it.
DO_BREAK_LINES: break lines at 76 characters
</pre>
<p>
Example: <code>encodeObject( myObj, Base64.GZIP )</code> or
<p>
Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DO_BREAK_LINES )</code></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serializableObject</code> - The object to encode</dd>
<dd><code>options</code> - Specified options</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP"><code>GZIP</code></a>,
<a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES"><code>DO_BREAK_LINES</code></a></dd>
</dl>
</li>
</ul>
<a name="encodeBytes-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeBytes</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeBytes(byte[]&nbsp;source)</pre>
<div class="block">Encodes a byte array into Base64 notation.
Does not GZip-compress data.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - The data to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The data in Base64-encoded form</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source array is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.4</dd>
</dl>
</li>
</ul>
<a name="encodeBytes-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeBytes</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeBytes(byte[]&nbsp;source,
int&nbsp;options)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Encodes a byte array into Base64 notation.
<p>
Example options:<pre>
GZIP: gzip-compresses object before encoding it.
DO_BREAK_LINES: break lines at 76 characters
<i>Note: Technically, this makes your encoding non-compliant.</i>
</pre>
<p>
Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
<p>
Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DO_BREAK_LINES )</code>
<p>As of v 2.3, if there is an error with the GZIP stream,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned a null value, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - The data to convert</dd>
<dd><code>options</code> - Specified options</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded data as a String</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source array is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP"><code>GZIP</code></a>,
<a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES"><code>DO_BREAK_LINES</code></a></dd>
</dl>
</li>
</ul>
<a name="encodeBytes-byte:A-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeBytes</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeBytes(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len)</pre>
<div class="block">Encodes a byte array into Base64 notation.
Does not GZip-compress data.
<p>As of v 2.3, if there is an error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned a null value, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">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="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded data as a String</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source array is null</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if source array, offset, or length are invalid</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.4</dd>
</dl>
</li>
</ul>
<a name="encodeBytes-byte:A-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeBytes</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeBytes(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Encodes a byte array into Base64 notation.
<p>
Example options:<pre>
GZIP: gzip-compresses object before encoding it.
DO_BREAK_LINES: break lines at 76 characters
<i>Note: Technically, this makes your encoding non-compliant.</i>
</pre>
<p>
Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
<p>
Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DO_BREAK_LINES )</code>
<p>As of v 2.3, if there is an error with the GZIP stream,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned a null value, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">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="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded data as a String</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source array is null</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if source array, offset, or length are invalid</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP"><code>GZIP</code></a>,
<a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES"><code>DO_BREAK_LINES</code></a></dd>
</dl>
</li>
</ul>
<a name="encodeBytesToBytes-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeBytesToBytes</h4>
<pre>public static&nbsp;byte[]&nbsp;encodeBytesToBytes(byte[]&nbsp;source)</pre>
<div class="block">Similar to <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-"><code>encodeBytes(byte[])</code></a> but returns
a byte array instead of instantiating a String. This is more efficient
if you're working with I/O streams and have large data sets to encode.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - The data to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded data as a byte[] (of ASCII characters)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source array is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.3.1</dd>
</dl>
</li>
</ul>
<a name="encodeBytesToBytes-byte:A-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeBytesToBytes</h4>
<pre>public static&nbsp;byte[]&nbsp;encodeBytesToBytes(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Similar to <a href="../../../../../org/apache/calcite/avatica/util/Base64.html#encodeBytes-byte:A-int-int-int-"><code>encodeBytes(byte[], int, int, int)</code></a> but returns
a byte array instead of instantiating a String. This is more efficient
if you're working with I/O streams and have large data sets to encode.</div>
<dl>
<dt><span class="paramLabel">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="returnLabel">Returns:</span></dt>
<dd>The Base64-encoded data as a String</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source array is null</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if source array, offset, or length are invalid</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.3.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/calcite/avatica/util/Base64.html#GZIP"><code>GZIP</code></a>,
<a href="../../../../../org/apache/calcite/avatica/util/Base64.html#DO_BREAK_LINES"><code>DO_BREAK_LINES</code></a></dd>
</dl>
</li>
</ul>
<a name="decode-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public static&nbsp;byte[]&nbsp;decode(byte[]&nbsp;source)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Low-level access to decoding ASCII characters in
the form of a byte array. <strong>Ignores GUNZIP option, if
it's set.</strong> This is not generally a recommended method,
although it is used internally as part of the decoding process.
Special case: if len = 0, an empty array is returned. Still,
if you need more speed and reduced memory footprint (and aren't
gzipping), consider this method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - The Base64 encoded data</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>decoded data</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.3.1</dd>
</dl>
</li>
</ul>
<a name="decode-byte:A-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public static&nbsp;byte[]&nbsp;decode(byte[]&nbsp;source,
int&nbsp;off,
int&nbsp;len,
int&nbsp;options)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Low-level access to decoding ASCII characters in
the form of a byte array. <strong>Ignores GUNZIP option, if
it's set.</strong> This is not generally a recommended method,
although it is used internally as part of the decoding process.
Special case: if len = 0, an empty array is returned. Still,
if you need more speed and reduced memory footprint (and aren't
gzipping), consider this method.</div>
<dl>
<dt><span class="paramLabel">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> - Can specify options such as alphabet type to use</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>decoded data</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If bogus characters exist in source data</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</dd>
</dl>
</li>
</ul>
<a name="decode-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public static&nbsp;byte[]&nbsp;decode(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Decodes data from Base64 notation, automatically
detecting gzip-compressed data and decompressing it.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>s</code> - the string to decode</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the decoded data</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If there is a problem</dd>
<dt><span class="simpleTagLabel">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&nbsp;byte[]&nbsp;decode(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s,
int&nbsp;options)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Decodes data from Base64 notation, automatically
detecting gzip-compressed data and decompressing it.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>s</code> - the string to decode</dd>
<dd><code>options</code> - encode options such as URL_SAFE</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the decoded data</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>s</code> is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.4</dd>
</dl>
</li>
</ul>
<a name="decodeToObject-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decodeToObject</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decodeToObject(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodedObject)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></pre>
<div class="block">Attempts to decode Base64 data and deserialize a Java
Object within. Returns <code>null</code> if there was an error.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>encodedObject</code> - The Base64 data to decode</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The decoded and deserialized object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if encodedObject is null</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is a general error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></code> - if the decoded object is of a
class that cannot be found by the JVM</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.5</dd>
</dl>
</li>
</ul>
<a name="decodeToObject-java.lang.String-int-java.lang.ClassLoader-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decodeToObject</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decodeToObject(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodedObject,
int&nbsp;options,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;loader)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></pre>
<div class="block">Attempts to decode Base64 data and deserialize a Java
Object within. Returns <code>null</code> if there was an error.
If <code>loader</code> is not null, it will be the class loader
used when deserializing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>encodedObject</code> - The Base64 data to decode</dd>
<dd><code>options</code> - Various parameters related to decoding</dd>
<dd><code>loader</code> - Optional class loader to use in deserializing classes.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The decoded and deserialized object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if encodedObject is null</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is a general error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</a></code> - if the decoded object is of a
class that cannot be found by the JVM</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.3.4</dd>
</dl>
</li>
</ul>
<a name="encodeToFile-byte:A-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeToFile</h4>
<pre>public static&nbsp;void&nbsp;encodeToFile(byte[]&nbsp;dataToEncode,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convenience method for encoding data to a file.
<p>As of v 2.3, if there is a error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned false, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">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="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if dataToEncode is null</dd>
<dt><span class="simpleTagLabel">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&nbsp;void&nbsp;decodeToFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dataToDecode,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convenience method for decoding data to a file.
<p>As of v 2.3, if there is a error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned false, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">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="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dt><span class="simpleTagLabel">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&nbsp;byte[]&nbsp;decodeFromFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convenience method for reading a base64-encoded
file and decoding it.
<p>As of v 2.3, if there is a error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned false, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - Filename for reading encoded data</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>decoded byte array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dt><span class="simpleTagLabel">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&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeFromFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convenience method for reading a binary file
and base64-encoding it.
<p>As of v 2.3, if there is a error,
the method will throw an java.io.IOException. <b>This is new to v2.3!</b>
In earlier versions, it just returned false, but
in retrospect that's a pretty poor way to handle it.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - Filename for reading binary data</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>base64-encoded string</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dt><span class="simpleTagLabel">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&nbsp;void&nbsp;encodeFileToFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;infile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;outfile)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Reads <code>infile</code> and encodes it to <code>outfile</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>infile</code> - Input file</dd>
<dd><code>outfile</code> - Output file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dt><span class="simpleTagLabel">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&nbsp;void&nbsp;decodeFileToFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;infile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;outfile)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Reads <code>infile</code> and decodes it to <code>outfile</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>infile</code> - Input file</dd>
<dd><code>outfile</code> - Output file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an error</dd>
<dt><span class="simpleTagLabel">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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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><a href="../../../../../org/apache/calcite/avatica/util/ArrayIteratorCursor.html" title="class in org.apache.calcite.avatica.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/calcite/avatica/util/Base64.InputStream.html" title="class in org.apache.calcite.avatica.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/calcite/avatica/util/Base64.html" target="_top">Frames</a></li>
<li><a href="Base64.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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 &#169; 2012&#x2013;2018 <a href="https://www.apache.org">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>