calmnetlib/JavaDoc/com/captainalm/lib/calmnet/packet/PacketLoader.html

812 lines
50 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_262) on Tue May 23 15:22:21 BST 2023 -->
<title>PacketLoader</title>
<meta name="date" content="2023-05-23">
<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="PacketLoader";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":9,"i2":10,"i3":9,"i4":10,"i5":9,"i6":9,"i7":9,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":9,"i15":10,"i16":10,"i17":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance 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="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.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/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/captainalm/lib/calmnet/packet/PacketLoader.html" target="_top">Frames</a></li>
<li><a href="PacketLoader.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&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">com.captainalm.lib.calmnet.packet</div>
<h2 title="Class PacketLoader" class="title">Class PacketLoader</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.captainalm.lib.calmnet.packet.PacketLoader</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">PacketLoader</span>
extends java.lang.Object</pre>
<div class="block">This class provides the ability to load and save <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a>
to <code>InputStream</code> and <code>OutputStream</code>.
Packets can have contents checking support using <code>DigestProvider</code>.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Captain ALM</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#PacketLoader--">PacketLoader</a></span>()</code>
<div class="block">Constructs a new Packet loader instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#PacketLoader-com.captainalm.lib.stdcrypt.digest.DigestProvider-">PacketLoader</a></span>(com.captainalm.lib.stdcrypt.digest.DigestProvider&nbsp;provider)</code>
<div class="block">Constructs a new Packet loader instance with the specified <code>DigestProvider</code>.</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="t2" class="tableTab"><span><a href="javascript:show(2);">Instance 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>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#areInvalidPacketsAllowed--">areInvalidPacketsAllowed</a></span>()</code>
<div class="block">Gets whether invalid packets are allowed to be read and written.</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="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getByteArrayFromInteger-int-">getByteArrayFromInteger</a></span>(int&nbsp;i)</code>
<div class="block">Saves an Integer into a byte array.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>com.captainalm.lib.stdcrypt.digest.DigestProvider</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getHashProvider--">getHashProvider</a></span>()</code>
<div class="block">This field provides the <code>DigestProvider</code> to use for the payload of the packets on the trailer.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getIntegerFromByteArray-byte:A-">getIntegerFromByteArray</a></span>(byte[]&nbsp;bytes)</code>
<div class="block">Loads an Integer from a byte array.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getPacketSize-com.captainalm.lib.calmnet.packet.IPacket-boolean-boolean-">getPacketSize</a></span>(<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;includeInformation,
boolean&nbsp;ignoreDigest)</code>
<div class="block">Gets the total size of a written packet in bytes.</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="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readArrayFromInputStream-java.io.InputStream-int-">readArrayFromInputStream</a></span>(java.io.InputStream&nbsp;inputStream,
int&nbsp;length)</code>
<div class="block">Reads in a byte array of a specified length from an <code>InputStream</code>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static byte</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readByteFromInputStream-java.io.InputStream-">readByteFromInputStream</a></span>(java.io.InputStream&nbsp;inputStream)</code>
<div class="block">Reads a byte from an <code>InputStream</code>.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readInteger-java.io.InputStream-">readInteger</a></span>(java.io.InputStream&nbsp;inputStream)</code>
<div class="block">Reads an Integer from an <code>InputStream</code>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readPacket-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">readPacket</a></span>(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)</code>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> from an input stream.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readPacketNoDigest-byte:A-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">readPacketNoDigest</a></span>(byte[]&nbsp;arrayIn,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)</code>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> from a byte array (No digest support).</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readPacketNoDigest-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">readPacketNoDigest</a></span>(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)</code>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> from an input stream (No digest support).</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readStreamedPacket-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">readStreamedPacket</a></span>(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)</code>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IStreamedPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IStreamedPacket</code></a> from an input stream.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#readStreamedPacketNoDigest-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">readStreamedPacketNoDigest</a></span>(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)</code>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IStreamedPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IStreamedPacket</code></a> from an input stream (No digest support).</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#setAllowInvalidPackets-boolean-">setAllowInvalidPackets</a></span>(boolean&nbsp;allowInvalidPackets)</code>
<div class="block">This sets whether invalid packets are allowed to be read and written.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#writeInteger-java.io.OutputStream-int-">writeInteger</a></span>(java.io.OutputStream&nbsp;outputStream,
int&nbsp;i)</code>
<div class="block">Writes an Integer to the <code>OutputStream</code> using 4 bytes.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#writePacket-java.io.OutputStream-com.captainalm.lib.calmnet.packet.IPacket-boolean-">writePacket</a></span>(java.io.OutputStream&nbsp;outputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;writeInformation)</code>
<div class="block">Writes a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> to an output stream (No digest support).</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#writePacketNoDigest-com.captainalm.lib.calmnet.packet.IPacket-boolean-">writePacketNoDigest</a></span>(<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;writeInformation)</code>
<div class="block">Returns a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> to a byte array (No digest support).</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#writePacketNoDigest-java.io.OutputStream-com.captainalm.lib.calmnet.packet.IPacket-boolean-">writePacketNoDigest</a></span>(java.io.OutputStream&nbsp;outputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;writeInformation)</code>
<div class="block">Writes a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> to an output stream.</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.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="PacketLoader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PacketLoader</h4>
<pre>public&nbsp;PacketLoader()</pre>
<div class="block">Constructs a new Packet loader instance.
If using a digest provider, use <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#PacketLoader-com.captainalm.lib.stdcrypt.digest.DigestProvider-"><code>PacketLoader(DigestProvider)</code></a></div>
</li>
</ul>
<a name="PacketLoader-com.captainalm.lib.stdcrypt.digest.DigestProvider-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PacketLoader</h4>
<pre>public&nbsp;PacketLoader(com.captainalm.lib.stdcrypt.digest.DigestProvider&nbsp;provider)</pre>
<div class="block">Constructs a new Packet loader instance with the specified <code>DigestProvider</code>.
If using a digest provider, make sure all endpoints use the same algorithm;
if null, no trailer is created or expected;
this is ignored if saving / loading packets from byte arrays.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>provider</code> - The digest provider or null.</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="getHashProvider--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHashProvider</h4>
<pre>public&nbsp;com.captainalm.lib.stdcrypt.digest.DigestProvider&nbsp;getHashProvider()</pre>
<div class="block">This field provides the <code>DigestProvider</code> to use for the payload of the packets on the trailer.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The digest provider in use or null.</dd>
</dl>
</li>
</ul>
<a name="areInvalidPacketsAllowed--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>areInvalidPacketsAllowed</h4>
<pre>public&nbsp;boolean&nbsp;areInvalidPacketsAllowed()</pre>
<div class="block">Gets whether invalid packets are allowed to be read and written.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>If invalid packets can be processed.</dd>
</dl>
</li>
</ul>
<a name="setAllowInvalidPackets-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAllowInvalidPackets</h4>
<pre>public&nbsp;void&nbsp;setAllowInvalidPackets(boolean&nbsp;allowInvalidPackets)</pre>
<div class="block">This sets whether invalid packets are allowed to be read and written.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>allowInvalidPackets</code> - If invalid packets can be processed.</dd>
</dl>
</li>
</ul>
<a name="readPacketNoDigest-byte:A-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readPacketNoDigest</h4>
<pre>public&nbsp;<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;readPacketNoDigest(byte[]&nbsp;arrayIn,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)
throws <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> from a byte array (No digest support).
If the information parameter is null, this is obtained as part of the reading.
NOTE: The <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getHashProvider--"><code>getHashProvider()</code></a> for digests is NOT supported and no digest is expected for these packets.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>arrayIn</code> - The byte array for reading.</dd>
<dd><code>factory</code> - The <a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory"><code>IPacketFactory</code></a> to use to generate packets.</dd>
<dd><code>information</code> - The protocol information or null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The loaded packet or null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - The arrayIn or the factory is null.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="readPacket-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readPacket</h4>
<pre>public&nbsp;<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;readPacket(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)
throws java.io.IOException,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> from an input stream.
If the information parameter is null, this is obtained as part of the reading.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream for reading.</dd>
<dd><code>factory</code> - The <a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory"><code>IPacketFactory</code></a> to use to generate packets.</dd>
<dd><code>information</code> - The protocol information or null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The loaded packet or null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - The inputStream or the factory is null.</dd>
<dd><code>java.io.IOException</code> - A stream exception occurs.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="readPacketNoDigest-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readPacketNoDigest</h4>
<pre>public&nbsp;<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;readPacketNoDigest(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)
throws java.io.IOException,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> from an input stream (No digest support).
If the information parameter is null, this is obtained as part of the reading.
NOTE: The <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getHashProvider--"><code>getHashProvider()</code></a> for digests is NOT supported and no digest is expected for these packets.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream for reading.</dd>
<dd><code>factory</code> - The <a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory"><code>IPacketFactory</code></a> to use to generate packets.</dd>
<dd><code>information</code> - The protocol information or null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The loaded packet or null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - The inputStream or the factory is null.</dd>
<dd><code>java.io.IOException</code> - A stream exception occurs.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="readStreamedPacket-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readStreamedPacket</h4>
<pre>public&nbsp;<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;readStreamedPacket(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)
throws java.io.IOException,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IStreamedPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IStreamedPacket</code></a> from an input stream.
If the information parameter is null, this is obtained as part of the reading.
NOTE: The packet may be an <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> if no stream packet is available for that protocol.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream for reading.</dd>
<dd><code>factory</code> - The <a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory"><code>IPacketFactory</code></a> to use to generate packets.</dd>
<dd><code>information</code> - The protocol information or null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The loaded packet or null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - The inputStream or the factory is null.</dd>
<dd><code>java.io.IOException</code> - A stream exception occurs.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="readStreamedPacketNoDigest-java.io.InputStream-com.captainalm.lib.calmnet.packet.factory.IPacketFactory-com.captainalm.lib.calmnet.packet.PacketProtocolInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readStreamedPacketNoDigest</h4>
<pre>public&nbsp;<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;readStreamedPacketNoDigest(java.io.InputStream&nbsp;inputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory">IPacketFactory</a>&nbsp;factory,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet">PacketProtocolInformation</a>&nbsp;information)
throws java.io.IOException,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Reads a <a href="../../../../../com/captainalm/lib/calmnet/packet/IStreamedPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IStreamedPacket</code></a> from an input stream (No digest support).
If the information parameter is null, this is obtained as part of the reading.
NOTE: The packet may be an <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> if no stream packet is available for that protocol.
NOTE: The <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getHashProvider--"><code>getHashProvider()</code></a> for digests is NOT supported and no digest is expected for these packets.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream for reading.</dd>
<dd><code>factory</code> - The <a href="../../../../../com/captainalm/lib/calmnet/packet/factory/IPacketFactory.html" title="interface in com.captainalm.lib.calmnet.packet.factory"><code>IPacketFactory</code></a> to use to generate packets.</dd>
<dd><code>information</code> - The protocol information or null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The loaded packet or null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - The inputStream or the factory is null.</dd>
<dd><code>java.io.IOException</code> - A stream exception occurs.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="writePacketNoDigest-com.captainalm.lib.calmnet.packet.IPacket-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writePacketNoDigest</h4>
<pre>public&nbsp;byte[]&nbsp;writePacketNoDigest(<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;writeInformation)
throws <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Returns a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> to a byte array (No digest support).
NOTE: The <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getHashProvider--"><code>getHashProvider()</code></a> for digests is NOT supported and no digest is expected for these packets.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>packet</code> - The packet to save.</dd>
<dd><code>writeInformation</code> - Write the <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet"><code>PacketProtocolInformation</code></a> to the beginning of the array.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - A parameter is null.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="writePacket-java.io.OutputStream-com.captainalm.lib.calmnet.packet.IPacket-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writePacket</h4>
<pre>public&nbsp;void&nbsp;writePacket(java.io.OutputStream&nbsp;outputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;writeInformation)
throws java.io.IOException,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Writes a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> to an output stream (No digest support).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>outputStream</code> - The output stream for writing.</dd>
<dd><code>packet</code> - The packet to save.</dd>
<dd><code>writeInformation</code> - Write the <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet"><code>PacketProtocolInformation</code></a> to the stream.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - A parameter is null.</dd>
<dd><code>java.io.IOException</code> - A stream exception occurs.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="writePacketNoDigest-java.io.OutputStream-com.captainalm.lib.calmnet.packet.IPacket-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writePacketNoDigest</h4>
<pre>public&nbsp;void&nbsp;writePacketNoDigest(java.io.OutputStream&nbsp;outputStream,
<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;writeInformation)
throws java.io.IOException,
<a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Writes a <a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet"><code>IPacket</code></a> to an output stream.
NOTE: The <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketLoader.html#getHashProvider--"><code>getHashProvider()</code></a> for digests is NOT supported and no digest is expected for these packets.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>outputStream</code> - The output stream for writing.</dd>
<dd><code>packet</code> - The packet to save.</dd>
<dd><code>writeInformation</code> - Write the <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet"><code>PacketProtocolInformation</code></a> to the stream.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - A parameter is null.</dd>
<dd><code>java.io.IOException</code> - A stream exception occurs.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - An Exception has occurred.</dd>
</dl>
</li>
</ul>
<a name="readInteger-java.io.InputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readInteger</h4>
<pre>public static&nbsp;int&nbsp;readInteger(java.io.InputStream&nbsp;inputStream)
throws java.io.IOException</pre>
<div class="block">Reads an Integer from an <code>InputStream</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream to use.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The integer that was stored.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - inputStream is null.</dd>
<dd><code>java.io.IOException</code> - An I/O error has occurred.</dd>
</dl>
</li>
</ul>
<a name="writeInteger-java.io.OutputStream-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeInteger</h4>
<pre>public static&nbsp;void&nbsp;writeInteger(java.io.OutputStream&nbsp;outputStream,
int&nbsp;i)
throws java.io.IOException</pre>
<div class="block">Writes an Integer to the <code>OutputStream</code> using 4 bytes.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>outputStream</code> - The output stream to use.</dd>
<dd><code>i</code> - The integer to store.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - outputStream is null.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - i is less than 0.</dd>
<dd><code>java.io.IOException</code> - An I/O error has occurred.</dd>
</dl>
</li>
</ul>
<a name="readByteFromInputStream-java.io.InputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readByteFromInputStream</h4>
<pre>public static&nbsp;byte&nbsp;readByteFromInputStream(java.io.InputStream&nbsp;inputStream)
throws java.io.IOException</pre>
<div class="block">Reads a byte from an <code>InputStream</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream to read from.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The byte read.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - inputStream is null.</dd>
<dd><code>java.io.IOException</code> - An I/O error has occurred or end of stream has been reached.</dd>
</dl>
</li>
</ul>
<a name="readArrayFromInputStream-java.io.InputStream-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readArrayFromInputStream</h4>
<pre>public static&nbsp;byte[]&nbsp;readArrayFromInputStream(java.io.InputStream&nbsp;inputStream,
int&nbsp;length)
throws java.io.IOException</pre>
<div class="block">Reads in a byte array of a specified length from an <code>InputStream</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The input stream to read from.</dd>
<dd><code>length</code> - The length of the stream.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The array of read bytes.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - inputStream is null.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - length is less than 0.</dd>
<dd><code>java.io.IOException</code> - An I/O error occurs or end of stream has been reached.</dd>
</dl>
</li>
</ul>
<a name="getByteArrayFromInteger-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getByteArrayFromInteger</h4>
<pre>public static&nbsp;byte[]&nbsp;getByteArrayFromInteger(int&nbsp;i)</pre>
<div class="block">Saves an Integer into a byte array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>i</code> - The integer to save.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The byte array.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - i is less than 0.</dd>
</dl>
</li>
</ul>
<a name="getIntegerFromByteArray-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIntegerFromByteArray</h4>
<pre>public static&nbsp;int&nbsp;getIntegerFromByteArray(byte[]&nbsp;bytes)</pre>
<div class="block">Loads an Integer from a byte array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>bytes</code> - The byte array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The integer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - bytes is null.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - bytes length is not 4.</dd>
</dl>
</li>
</ul>
<a name="getPacketSize-com.captainalm.lib.calmnet.packet.IPacket-boolean-boolean-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getPacketSize</h4>
<pre>public&nbsp;int&nbsp;getPacketSize(<a href="../../../../../com/captainalm/lib/calmnet/packet/IPacket.html" title="interface in com.captainalm.lib.calmnet.packet">IPacket</a>&nbsp;packet,
boolean&nbsp;includeInformation,
boolean&nbsp;ignoreDigest)
throws <a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></pre>
<div class="block">Gets the total size of a written packet in bytes.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>packet</code> - The packet to check.</dd>
<dd><code>includeInformation</code> - If the 2 byte information header is included.</dd>
<dd><code>ignoreDigest</code> - If the digest length should be ignored if available.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The size of the packet in bytes.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - packet is null.</dd>
<dd><code><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet">PacketException</a></code> - A Packet Exception has occurred.</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="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.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/captainalm/lib/calmnet/packet/PacketException.html" title="class in com.captainalm.lib.calmnet.packet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/captainalm/lib/calmnet/packet/PacketProtocolInformation.html" title="class in com.captainalm.lib.calmnet.packet"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/captainalm/lib/calmnet/packet/PacketLoader.html" target="_top">Frames</a></li>
<li><a href="PacketLoader.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>