<!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 (version 1.7.0_09-icedtea) on Sat Mar 02 06:46:26 UTC 2013 --> <title>OtpOutputStream (Java-Erlang Interface Library)</title> <meta name="date" content="2013-03-02"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="OtpOutputStream (Java-Erlang Interface Library)"; } //--> </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="../../../../com/ericsson/otp/erlang/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</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="../../../../com/ericsson/otp/erlang/OtpNodeStatus.html" title="class in com.ericsson.otp.erlang"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/ericsson/otp/erlang/OtpPeer.html" title="class in com.ericsson.otp.erlang"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ericsson/otp/erlang/OtpOutputStream.html" target="_top">Frames</a></li> <li><a href="OtpOutputStream.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>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li><a href="#constructor_summary">Constr</a> | </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><a href="#constructor_detail">Constr</a> | </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">com.ericsson.otp.erlang</div> <h2 title="Class OtpOutputStream" class="title">Class OtpOutputStream</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.io.OutputStream</li> <li> <ul class="inheritance"> <li>java.io.ByteArrayOutputStream</li> <li> <ul class="inheritance"> <li>com.ericsson.otp.erlang.OtpOutputStream</li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable</dd> </dl> <hr> <br> <pre>public class <span class="strong">OtpOutputStream</span> extends java.io.ByteArrayOutputStream</pre> <div class="block">Provides a stream for encoding Erlang terms to external format, for transmission or storage. <p> Note that this class is not synchronized, if you need synchronization you must provide it yourself.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== 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="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#defaultIncrement">defaultIncrement</a></strong></code> <div class="block">The default increment used when growing the stream (increment at least this much).</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#defaultInitialSize">defaultInitialSize</a></strong></code> <div class="block">The default initial size of the stream.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_java.io.ByteArrayOutputStream"> <!-- --> </a> <h3>Fields inherited from class java.io.ByteArrayOutputStream</h3> <code>buf, count</code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#OtpOutputStream()">OtpOutputStream</a></strong>()</code> <div class="block">Create a stream with the default initial size (2048 bytes).</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#OtpOutputStream(int)">OtpOutputStream</a></strong>(int size)</code> <div class="block">Create a stream with the specified initial size.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#OtpOutputStream(com.ericsson.otp.erlang.OtpErlangObject)">OtpOutputStream</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> o)</code> <div class="block">Create a stream containing the encoded version of the given Erlang term.</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>int</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#count()">count</a></strong>()</code> <div class="block"><strong>Deprecated.</strong> <div class="block"><i>As of Jinterface 1.4, replaced by super.size().</i></div> </div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#ensureCapacity(int)">ensureCapacity</a></strong>(int minCapacity)</code> <div class="block">Increases the capacity of this <tt>OtpOutputStream</tt> instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#getPos()">getPos</a></strong>()</code> <div class="block">Get the current position in the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#length()">length</a></strong>()</code> <div class="block">Get the current capacity of the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#poke4BE(int, long)">poke4BE</a></strong>(int offset, long n)</code> <div class="block">Write the low four bytes of a value to the stream in bif endian order, at the specified position.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#trimToSize()">trimToSize</a></strong>()</code> <div class="block">Trims the capacity of this <tt>OtpOutputStream</tt> instance to be the buffer's current size.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_any(com.ericsson.otp.erlang.OtpErlangObject)">write_any</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> o)</code> <div class="block">Write an arbitrary Erlang term to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_atom(java.lang.String)">write_atom</a></strong>(java.lang.String atom)</code> <div class="block">Write a string to the stream as an Erlang atom.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_big_integer(java.math.BigInteger)">write_big_integer</a></strong>(java.math.BigInteger v)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_binary(byte[])">write_binary</a></strong>(byte[] bin)</code> <div class="block">Write an array of bytes to the stream as an Erlang binary.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_bitstr(byte[], int)">write_bitstr</a></strong>(byte[] bin, int pad_bits)</code> <div class="block">Write an array of bytes to the stream as an Erlang bitstr.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_boolean(boolean)">write_boolean</a></strong>(boolean b)</code> <div class="block">Write a boolean value to the stream as the Erlang atom 'true' or 'false'.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_byte(byte)">write_byte</a></strong>(byte b)</code> <div class="block">Write a single byte to the stream as an Erlang integer.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_char(char)">write_char</a></strong>(char c)</code> <div class="block">Write a character to the stream as an Erlang integer.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_compressed(com.ericsson.otp.erlang.OtpErlangObject)">write_compressed</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> o)</code> <div class="block">Write an arbitrary Erlang term to the stream in compressed format.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_double(double)">write_double</a></strong>(double d)</code> <div class="block">Write a double value to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_external_fun(java.lang.String, java.lang.String, int)">write_external_fun</a></strong>(java.lang.String module, java.lang.String function, int arity)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_float(float)">write_float</a></strong>(float f)</code> <div class="block">Write a float value to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_fun(com.ericsson.otp.erlang.OtpErlangPid, java.lang.String, long, int, byte[], long, long, com.ericsson.otp.erlang.OtpErlangObject[])">write_fun</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang">OtpErlangPid</a> pid, java.lang.String module, long old_index, int arity, byte[] md5, long index, long uniq, <a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a>[] freeVars)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_int(int)">write_int</a></strong>(int i)</code> <div class="block">Write an integer to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_list_head(int)">write_list_head</a></strong>(int arity)</code> <div class="block">Write an Erlang list header to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_long(long)">write_long</a></strong>(long l)</code> <div class="block">Write a long to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_nil()">write_nil</a></strong>()</code> <div class="block">Write an empty Erlang list to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_pid(java.lang.String, int, int, int)">write_pid</a></strong>(java.lang.String node, int id, int serial, int creation)</code> <div class="block">Write an Erlang PID to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_port(java.lang.String, int, int)">write_port</a></strong>(java.lang.String node, int id, int creation)</code> <div class="block">Write an Erlang port to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_ref(java.lang.String, int[], int)">write_ref</a></strong>(java.lang.String node, int[] ids, int creation)</code> <div class="block">Write a new style (R6 and later) Erlang ref to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_ref(java.lang.String, int, int)">write_ref</a></strong>(java.lang.String node, int id, int creation)</code> <div class="block">Write an old style Erlang ref to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_short(short)">write_short</a></strong>(short s)</code> <div class="block">Write a short to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_string(java.lang.String)">write_string</a></strong>(java.lang.String s)</code> <div class="block">Write a string to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_tuple_head(int)">write_tuple_head</a></strong>(int arity)</code> <div class="block">Write an Erlang tuple header to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_uint(int)">write_uint</a></strong>(int ui)</code> <div class="block">Write a positive integer to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_ulong(long)">write_ulong</a></strong>(long ul)</code> <div class="block">Write a positive long to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write_ushort(short)">write_ushort</a></strong>(short us)</code> <div class="block">Write a positive short to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write(byte)">write</a></strong>(byte b)</code> <div class="block">Write one byte to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write(byte[])">write</a></strong>(byte[] buf)</code> <div class="block">Write an array of bytes to the stream.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write1(long)">write1</a></strong>(long n)</code> <div class="block">Write the low byte of a value to the stream.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write2BE(long)">write2BE</a></strong>(long n)</code> <div class="block">Write the low two bytes of a value to the stream in big endian order.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write2LE(long)">write2LE</a></strong>(long n)</code> <div class="block">Write the low two bytes of a value to the stream in little endian order.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write4BE(long)">write4BE</a></strong>(long n)</code> <div class="block">Write the low four bytes of a value to the stream in big endian order.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write4LE(long)">write4LE</a></strong>(long n)</code> <div class="block">Write the low four bytes of a value to the stream in little endian order.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write8BE(long)">write8BE</a></strong>(long n)</code> <div class="block">Write the low eight (all) bytes of a value to the stream in big endian order.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#write8LE(long)">write8LE</a></strong>(long n)</code> <div class="block">Write the low eight bytes of a value to the stream in little endian order.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#writeLE(long, int)">writeLE</a></strong>(long n, int b)</code> <div class="block">Write any number of bytes in little endian format.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpOutputStream.html#writeN(byte[])">writeN</a></strong>(byte[] bytes)</code> <div class="block">Write an array of bytes to the stream.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.io.ByteArrayOutputStream"> <!-- --> </a> <h3>Methods inherited from class java.io.ByteArrayOutputStream</h3> <code>close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.io.OutputStream"> <!-- --> </a> <h3>Methods inherited from class java.io.OutputStream</h3> <code>flush</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</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="defaultInitialSize"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>defaultInitialSize</h4> <pre>public static final int defaultInitialSize</pre> <div class="block">The default initial size of the stream. *</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#com.ericsson.otp.erlang.OtpOutputStream.defaultInitialSize">Constant Field Values</a></dd></dl> </li> </ul> <a name="defaultIncrement"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>defaultIncrement</h4> <pre>public static final int defaultIncrement</pre> <div class="block">The default increment used when growing the stream (increment at least this much). *</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#com.ericsson.otp.erlang.OtpOutputStream.defaultIncrement">Constant Field Values</a></dd></dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="OtpOutputStream()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>OtpOutputStream</h4> <pre>public OtpOutputStream()</pre> <div class="block">Create a stream with the default initial size (2048 bytes).</div> </li> </ul> <a name="OtpOutputStream(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>OtpOutputStream</h4> <pre>public OtpOutputStream(int size)</pre> <div class="block">Create a stream with the specified initial size.</div> </li> </ul> <a name="OtpOutputStream(com.ericsson.otp.erlang.OtpErlangObject)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>OtpOutputStream</h4> <pre>public OtpOutputStream(<a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> o)</pre> <div class="block">Create a stream containing the encoded version of the given Erlang term.</div> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getPos()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPos</h4> <pre>public int getPos()</pre> <div class="block">Get the current position in the stream.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the current position in the stream.</dd></dl> </li> </ul> <a name="trimToSize()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>trimToSize</h4> <pre>public void trimToSize()</pre> <div class="block">Trims the capacity of this <tt>OtpOutputStream</tt> instance to be the buffer's current size. An application can use this operation to minimize the storage of an <tt>OtpOutputStream</tt> instance.</div> </li> </ul> <a name="ensureCapacity(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ensureCapacity</h4> <pre>public void ensureCapacity(int minCapacity)</pre> <div class="block">Increases the capacity of this <tt>OtpOutputStream</tt> instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>minCapacity</code> - the desired minimum capacity</dd></dl> </li> </ul> <a name="write(byte)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write</h4> <pre>public void write(byte b)</pre> <div class="block">Write one byte to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - the byte to write.</dd></dl> </li> </ul> <a name="write(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write</h4> <pre>public void write(byte[] buf)</pre> <div class="block">Write an array of bytes to the stream.</div> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>write</code> in class <code>java.io.OutputStream</code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>buf</code> - the array of bytes to write.</dd></dl> </li> </ul> <a name="write1(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write1</h4> <pre>public void write1(long n)</pre> <div class="block">Write the low byte of a value to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="writeN(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeN</h4> <pre>public void writeN(byte[] bytes)</pre> <div class="block">Write an array of bytes to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buf</code> - the array of bytes to write.</dd></dl> </li> </ul> <a name="length()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>length</h4> <pre>public int length()</pre> <div class="block">Get the current capacity of the stream. As bytes are added the capacity of the stream is increased automatically, however this method returns the current size.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the size of the internal buffer used by the stream.</dd></dl> </li> </ul> <a name="count()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>count</h4> <pre>@Deprecated public int count()</pre> <div class="block"><span class="strong">Deprecated.</span> <i>As of Jinterface 1.4, replaced by super.size().</i></div> <div class="block">Get the number of bytes in the stream.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the number of bytes in the stream.</dd><dt><span class="strong">See Also:</span></dt><dd><code>ByteArrayOutputStream.size()</code></dd></dl> </li> </ul> <a name="write2BE(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write2BE</h4> <pre>public void write2BE(long n)</pre> <div class="block">Write the low two bytes of a value to the stream in big endian order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="write4BE(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write4BE</h4> <pre>public void write4BE(long n)</pre> <div class="block">Write the low four bytes of a value to the stream in big endian order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="write8BE(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write8BE</h4> <pre>public void write8BE(long n)</pre> <div class="block">Write the low eight (all) bytes of a value to the stream in big endian order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="writeLE(long, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeLE</h4> <pre>public void writeLE(long n, int b)</pre> <div class="block">Write any number of bytes in little endian format.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd><dd><code>b</code> - the number of bytes to write from the little end.</dd></dl> </li> </ul> <a name="write2LE(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write2LE</h4> <pre>public void write2LE(long n)</pre> <div class="block">Write the low two bytes of a value to the stream in little endian order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="write4LE(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write4LE</h4> <pre>public void write4LE(long n)</pre> <div class="block">Write the low four bytes of a value to the stream in little endian order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="write8LE(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write8LE</h4> <pre>public void write8LE(long n)</pre> <div class="block">Write the low eight bytes of a value to the stream in little endian order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="poke4BE(int, long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>poke4BE</h4> <pre>public void poke4BE(int offset, long n)</pre> <div class="block">Write the low four bytes of a value to the stream in bif endian order, at the specified position. If the position specified is beyond the end of the stream, this method will have no effect. Normally this method should be used in conjunction with <code>size()</code>, when is is necessary to insert data into the stream before it is known what the actual value should be. For example: <pre> int pos = s.size(); s.write4BE(0); // make space for length data, // but final value is not yet known [ ...more write statements...] // later... when we know the length value s.poke4BE(pos, length); </pre></div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>offset</code> - the position in the stream.</dd><dd><code>n</code> - the value to use.</dd></dl> </li> </ul> <a name="write_atom(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_atom</h4> <pre>public void write_atom(java.lang.String atom)</pre> <div class="block">Write a string to the stream as an Erlang atom.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>atom</code> - the string to write.</dd></dl> </li> </ul> <a name="write_binary(byte[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_binary</h4> <pre>public void write_binary(byte[] bin)</pre> <div class="block">Write an array of bytes to the stream as an Erlang binary.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>bin</code> - the array of bytes to write.</dd></dl> </li> </ul> <a name="write_bitstr(byte[], int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_bitstr</h4> <pre>public void write_bitstr(byte[] bin, int pad_bits)</pre> <div class="block">Write an array of bytes to the stream as an Erlang bitstr.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>bin</code> - the array of bytes to write.</dd><dd><code>pad_bits</code> - the number of zero pad bits at the low end of the last byte</dd></dl> </li> </ul> <a name="write_boolean(boolean)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_boolean</h4> <pre>public void write_boolean(boolean b)</pre> <div class="block">Write a boolean value to the stream as the Erlang atom 'true' or 'false'.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - the boolean value to write.</dd></dl> </li> </ul> <a name="write_byte(byte)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_byte</h4> <pre>public void write_byte(byte b)</pre> <div class="block">Write a single byte to the stream as an Erlang integer. The byte is really an IDL 'octet', that is, unsigned.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>b</code> - the byte to use.</dd></dl> </li> </ul> <a name="write_char(char)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_char</h4> <pre>public void write_char(char c)</pre> <div class="block">Write a character to the stream as an Erlang integer. The character may be a 16 bit character, kind of IDL 'wchar'. It is up to the Erlang side to take care of souch, if they should be used.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>c</code> - the character to use.</dd></dl> </li> </ul> <a name="write_double(double)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_double</h4> <pre>public void write_double(double d)</pre> <div class="block">Write a double value to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>d</code> - the double to use.</dd></dl> </li> </ul> <a name="write_float(float)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_float</h4> <pre>public void write_float(float f)</pre> <div class="block">Write a float value to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>f</code> - the float to use.</dd></dl> </li> </ul> <a name="write_big_integer(java.math.BigInteger)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_big_integer</h4> <pre>public void write_big_integer(java.math.BigInteger v)</pre> </li> </ul> <a name="write_long(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_long</h4> <pre>public void write_long(long l)</pre> <div class="block">Write a long to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>l</code> - the long to use.</dd></dl> </li> </ul> <a name="write_ulong(long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_ulong</h4> <pre>public void write_ulong(long ul)</pre> <div class="block">Write a positive long to the stream. The long is interpreted as a two's complement unsigned long even if it is negative.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>ul</code> - the long to use.</dd></dl> </li> </ul> <a name="write_int(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_int</h4> <pre>public void write_int(int i)</pre> <div class="block">Write an integer to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - the integer to use.</dd></dl> </li> </ul> <a name="write_uint(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_uint</h4> <pre>public void write_uint(int ui)</pre> <div class="block">Write a positive integer to the stream. The integer is interpreted as a two's complement unsigned integer even if it is negative.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>ui</code> - the integer to use.</dd></dl> </li> </ul> <a name="write_short(short)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_short</h4> <pre>public void write_short(short s)</pre> <div class="block">Write a short to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - the short to use.</dd></dl> </li> </ul> <a name="write_ushort(short)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_ushort</h4> <pre>public void write_ushort(short us)</pre> <div class="block">Write a positive short to the stream. The short is interpreted as a two's complement unsigned short even if it is negative.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - the short to use.</dd></dl> </li> </ul> <a name="write_list_head(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_list_head</h4> <pre>public void write_list_head(int arity)</pre> <div class="block">Write an Erlang list header to the stream. After calling this method, you must write 'arity' elements to the stream followed by nil, or it will not be possible to decode it later.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>arity</code> - the number of elements in the list.</dd></dl> </li> </ul> <a name="write_nil()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_nil</h4> <pre>public void write_nil()</pre> <div class="block">Write an empty Erlang list to the stream.</div> </li> </ul> <a name="write_tuple_head(int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_tuple_head</h4> <pre>public void write_tuple_head(int arity)</pre> <div class="block">Write an Erlang tuple header to the stream. After calling this method, you must write 'arity' elements to the stream or it will not be possible to decode it later.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>arity</code> - the number of elements in the tuple.</dd></dl> </li> </ul> <a name="write_pid(java.lang.String, int, int, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_pid</h4> <pre>public void write_pid(java.lang.String node, int id, int serial, int creation)</pre> <div class="block">Write an Erlang PID to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the nodename.</dd><dd><code>id</code> - an arbitrary number. Only the low order 15 bits will be used.</dd><dd><code>serial</code> - another arbitrary number. Only the low order 13 bits will be used.</dd><dd><code>creation</code> - yet another arbitrary number. Only the low order 2 bits will be used.</dd></dl> </li> </ul> <a name="write_port(java.lang.String, int, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_port</h4> <pre>public void write_port(java.lang.String node, int id, int creation)</pre> <div class="block">Write an Erlang port to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the nodename.</dd><dd><code>id</code> - an arbitrary number. Only the low order 28 bits will be used.</dd><dd><code>creation</code> - another arbitrary number. Only the low order 2 bits will be used.</dd></dl> </li> </ul> <a name="write_ref(java.lang.String, int, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_ref</h4> <pre>public void write_ref(java.lang.String node, int id, int creation)</pre> <div class="block">Write an old style Erlang ref to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the nodename.</dd><dd><code>id</code> - an arbitrary number. Only the low order 18 bits will be used.</dd><dd><code>creation</code> - another arbitrary number. Only the low order 2 bits will be used.</dd></dl> </li> </ul> <a name="write_ref(java.lang.String, int[], int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_ref</h4> <pre>public void write_ref(java.lang.String node, int[] ids, int creation)</pre> <div class="block">Write a new style (R6 and later) Erlang ref to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the nodename.</dd><dd><code>ids</code> - an array of arbitrary numbers. Only the low order 18 bits of the first number will be used. If the array contains only one number, an old style ref will be written instead. At most three numbers will be read from the array.</dd><dd><code>creation</code> - another arbitrary number. Only the low order 2 bits will be used.</dd></dl> </li> </ul> <a name="write_string(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_string</h4> <pre>public void write_string(java.lang.String s)</pre> <div class="block">Write a string to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - the string to write.</dd></dl> </li> </ul> <a name="write_compressed(com.ericsson.otp.erlang.OtpErlangObject)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_compressed</h4> <pre>public void write_compressed(<a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> o)</pre> <div class="block">Write an arbitrary Erlang term to the stream in compressed format.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>o</code> - the Erlang tem to write.</dd></dl> </li> </ul> <a name="write_any(com.ericsson.otp.erlang.OtpErlangObject)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_any</h4> <pre>public void write_any(<a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> o)</pre> <div class="block">Write an arbitrary Erlang term to the stream.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>o</code> - the Erlang term to write.</dd></dl> </li> </ul> <a name="write_fun(com.ericsson.otp.erlang.OtpErlangPid, java.lang.String, long, int, byte[], long, long, com.ericsson.otp.erlang.OtpErlangObject[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write_fun</h4> <pre>public void write_fun(<a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang">OtpErlangPid</a> pid, java.lang.String module, long old_index, int arity, byte[] md5, long index, long uniq, <a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a>[] freeVars)</pre> </li> </ul> <a name="write_external_fun(java.lang.String, java.lang.String, int)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>write_external_fun</h4> <pre>public void write_external_fun(java.lang.String module, java.lang.String function, int arity)</pre> </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="../../../../com/ericsson/otp/erlang/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</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="../../../../com/ericsson/otp/erlang/OtpNodeStatus.html" title="class in com.ericsson.otp.erlang"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/ericsson/otp/erlang/OtpPeer.html" title="class in com.ericsson.otp.erlang"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ericsson/otp/erlang/OtpOutputStream.html" target="_top">Frames</a></li> <li><a href="OtpOutputStream.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>Nested | </li> <li><a href="#field_summary">Field</a> | </li> <li><a href="#constructor_summary">Constr</a> | </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><a href="#constructor_detail">Constr</a> | </li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>