blob: b08572ab5076b95200f471c1a652790e628eca49 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>ReadableBuffer (Qpid Proton-J API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ReadableBuffer (Qpid Proton-J API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6,"i22":6,"i23":6,"i24":6,"i25":6,"i26":6,"i27":6,"i28":6,"i29":6,"i30":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/qpid/proton/codec/PrimitiveTypeEncoding.html" title="interface in org.apache.qpid.proton.codec"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.ByteBufferReader.html" title="class in org.apache.qpid.proton.codec"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/qpid/proton/codec/ReadableBuffer.html" target="_top">Frames</a></li>
<li><a href="ReadableBuffer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.qpid.proton.codec</div>
<h2 title="Interface ReadableBuffer" class="title">Interface ReadableBuffer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../org/apache/qpid/proton/codec/CompositeReadableBuffer.html" title="class in org.apache.qpid.proton.codec">CompositeReadableBuffer</a>, <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.ByteBufferReader.html" title="class in org.apache.qpid.proton.codec">ReadableBuffer.ByteBufferReader</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">ReadableBuffer</span></pre>
<div class="block">Interface to abstract a buffer, similar to <a href="../../../../../org/apache/qpid/proton/codec/WritableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>WritableBuffer</code></a></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.ByteBufferReader.html" title="class in org.apache.qpid.proton.codec">ReadableBuffer.ByteBufferReader</a></span></code>&nbsp;</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="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#array--">array</a></span>()</code>
<div class="block">Returns the primitive array that backs this buffer if one exists and the
buffer is not read-only.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#arrayOffset--">arrayOffset</a></span>()</code>
<div class="block">Returns the offset into the backing array of the first element in the buffer.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#byteBuffer--">byteBuffer</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#capacity--">capacity</a></span>()</code>
<div class="block">Returns the capacity of the backing buffer of this ReadableBuffer</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#clear--">clear</a></span>()</code>
<div class="block">Resets the buffer position to zero and sets the limit to the buffer capacity,
the mark value is discarded if set.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#duplicate--">duplicate</a></span>()</code>
<div class="block">Creates a duplicate <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a> to this instance.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#flip--">flip</a></span>()</code>
<div class="block">Sets the buffer limit to the current position and the position is set to zero, the
mark value reset to undefined.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>byte</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#get--">get</a></span>()</code>
<div class="block">Reads the byte at the current position and advances the position by 1.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#get-byte:A-">get</a></span>(byte[]&nbsp;target)</code>
<div class="block">A bulk read method that copies bytes from this buffer into the target byte array.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#get-byte:A-int-int-">get</a></span>(byte[]&nbsp;target,
int&nbsp;offset,
int&nbsp;length)</code>
<div class="block">A bulk read method that copies bytes from this buffer into the target byte array.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>byte</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#get-int-">get</a></span>(int&nbsp;index)</code>
<div class="block">Reads the byte at the given index, the buffer position is not affected.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#get-org.apache.qpid.proton.codec.WritableBuffer-">get</a></span>(<a href="../../../../../org/apache/qpid/proton/codec/WritableBuffer.html" title="interface in org.apache.qpid.proton.codec">WritableBuffer</a>&nbsp;target)</code>
<div class="block">Copy data from this buffer to the target buffer starting from the current
position and continuing until either this buffer's remaining bytes are
consumed or the target is full.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#getDouble--">getDouble</a></span>()</code>
<div class="block">Reads eight bytes from the buffer and returns them as an double value.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#getFloat--">getFloat</a></span>()</code>
<div class="block">Reads four bytes from the buffer and returns them as an float value.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#getInt--">getInt</a></span>()</code>
<div class="block">Reads four bytes from the buffer and returns them as an integer value.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#getLong--">getLong</a></span>()</code>
<div class="block">Reads eight bytes from the buffer and returns them as an long value.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>short</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#getShort--">getShort</a></span>()</code>
<div class="block">Reads two bytes from the buffer and returns them as an short value.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#hasArray--">hasArray</a></span>()</code>
<div class="block">Returns true if this ReadableBuffer is backed by an array which can be
accessed by the <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#array--"><code>array()</code></a> and <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#arrayOffset--"><code>arrayOffset()</code></a> methods.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#hasRemaining--">hasRemaining</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#limit--">limit</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#limit-int-">limit</a></span>(int&nbsp;limit)</code>
<div class="block">Sets the current read limit of this buffer to the given value.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#mark--">mark</a></span>()</code>
<div class="block">Mark the current position of this buffer which can be returned to after a
read operation by calling <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#reset--"><code>reset()</code></a>.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#position--">position</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#position-int-">position</a></span>(int&nbsp;position)</code>
<div class="block">Sets the current position of this buffer to the given value.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#readString-java.nio.charset.CharsetDecoder-">readString</a></span>(java.nio.charset.CharsetDecoder&nbsp;decoder)</code>
<div class="block">Decodes a String from the buffer using the provided <code>CharsetDecoder</code>
starting the decode at the current position and reading until the limit is
reached.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#readUTF8--">readUTF8</a></span>()</code>
<div class="block">Reads a UTF-8 encoded String from the buffer starting the decode at the
current position and reading until the limit is reached.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#reclaimRead--">reclaimRead</a></span>()</code>
<div class="block">Compact the backing storage of this ReadableBuffer, possibly freeing previously-read
portions of pooled data or reducing the number of backing arrays if present.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#remaining--">remaining</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#reset--">reset</a></span>()</code>
<div class="block">Reset the buffer's position to a previously marked value, the mark should remain
set after calling this method.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#rewind--">rewind</a></span>()</code>
<div class="block">Resets the buffer position to zero and clears and previously set mark.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#slice--">slice</a></span>()</code>
<div class="block">Creates a new ReadableBuffer instance that is a view of the readable portion of
this buffer.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="capacity--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>capacity</h4>
<pre>int&nbsp;capacity()</pre>
<div class="block">Returns the capacity of the backing buffer of this ReadableBuffer</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the capacity of the backing buffer of this ReadableBuffer</dd>
</dl>
</li>
</ul>
<a name="hasArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasArray</h4>
<pre>boolean&nbsp;hasArray()</pre>
<div class="block">Returns true if this ReadableBuffer is backed by an array which can be
accessed by the <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#array--"><code>array()</code></a> and <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#arrayOffset--"><code>arrayOffset()</code></a> methods.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the buffer is backed by a primitive array.</dd>
</dl>
</li>
</ul>
<a name="array--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>array</h4>
<pre>byte[]&nbsp;array()</pre>
<div class="block">Returns the primitive array that backs this buffer if one exists and the
buffer is not read-only. The caller should have checked the <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#hasArray--"><code>hasArray()</code></a>
method before calling this method.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the array that backs this buffer is available.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.UnsupportedOperationException</code> - if this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a> doesn't support array access.</dd>
<dd><code>java.nio.ReadOnlyBufferException</code> - if the ReadableBuffer is read-only.</dd>
</dl>
</li>
</ul>
<a name="arrayOffset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>arrayOffset</h4>
<pre>int&nbsp;arrayOffset()</pre>
<div class="block">Returns the offset into the backing array of the first element in the buffer. The caller
should have checked the <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#hasArray--"><code>hasArray()</code></a> method before calling this method.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the offset into the backing array of the first element in the buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.UnsupportedOperationException</code> - if this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a> doesn't support array access.</dd>
<dd><code>java.nio.ReadOnlyBufferException</code> - if the ReadableBuffer is read-only.</dd>
</dl>
</li>
</ul>
<a name="reclaimRead--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reclaimRead</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;reclaimRead()</pre>
<div class="block">Compact the backing storage of this ReadableBuffer, possibly freeing previously-read
portions of pooled data or reducing the number of backing arrays if present.
<p>
This is an optional operation and care should be taken in its implementation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this buffer</dd>
</dl>
</li>
</ul>
<a name="get--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>byte&nbsp;get()</pre>
<div class="block">Reads the byte at the current position and advances the position by 1.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the byte at the current position.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the buffer position has reached the limit.</dd>
</dl>
</li>
</ul>
<a name="get-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>byte&nbsp;get(int&nbsp;index)</pre>
<div class="block">Reads the byte at the given index, the buffer position is not affected.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index in the buffer from which to read the byte.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the byte value stored at the target index.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IndexOutOfBoundsException</code> - if the index is not in range for this buffer.</dd>
</dl>
</li>
</ul>
<a name="getInt--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>int&nbsp;getInt()</pre>
<div class="block">Reads four bytes from the buffer and returns them as an integer value. The
buffer position is advanced by four byes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>and integer value composed of bytes read from the buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the buffer position has reached the limit.</dd>
</dl>
</li>
</ul>
<a name="getLong--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLong</h4>
<pre>long&nbsp;getLong()</pre>
<div class="block">Reads eight bytes from the buffer and returns them as an long value. The
buffer position is advanced by eight byes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>and long value composed of bytes read from the buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the buffer position has reached the limit.</dd>
</dl>
</li>
</ul>
<a name="getShort--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getShort</h4>
<pre>short&nbsp;getShort()</pre>
<div class="block">Reads two bytes from the buffer and returns them as an short value. The
buffer position is advanced by two byes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>and short value composed of bytes read from the buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the buffer position has reached the limit.</dd>
</dl>
</li>
</ul>
<a name="getFloat--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFloat</h4>
<pre>float&nbsp;getFloat()</pre>
<div class="block">Reads four bytes from the buffer and returns them as an float value. The
buffer position is advanced by four byes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>and float value composed of bytes read from the buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the buffer position has reached the limit.</dd>
</dl>
</li>
</ul>
<a name="getDouble--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDouble</h4>
<pre>double&nbsp;getDouble()</pre>
<div class="block">Reads eight bytes from the buffer and returns them as an double value. The
buffer position is advanced by eight byes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>and double value composed of bytes read from the buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the buffer position has reached the limit.</dd>
</dl>
</li>
</ul>
<a name="get-byte:A-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;get(byte[]&nbsp;target,
int&nbsp;offset,
int&nbsp;length)</pre>
<div class="block">A bulk read method that copies bytes from this buffer into the target byte array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - The byte array to copy bytes read from this buffer.</dd>
<dd><code>offset</code> - The offset into the given array where the copy starts.</dd>
<dd><code>length</code> - The number of bytes to copy into the target array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this ReadableBuffer instance.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the are less readable bytes than the array length.</dd>
<dd><code>java.lang.IndexOutOfBoundsException</code> - if the offset or length values are invalid.</dd>
</dl>
</li>
</ul>
<a name="get-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;get(byte[]&nbsp;target)</pre>
<div class="block">A bulk read method that copies bytes from this buffer into the target byte array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - The byte array to copy bytes read from this buffer.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this ReadableBuffer instance.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.BufferUnderflowException</code> - if the are less readable bytes than the array length.</dd>
</dl>
</li>
</ul>
<a name="get-org.apache.qpid.proton.codec.WritableBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;get(<a href="../../../../../org/apache/qpid/proton/codec/WritableBuffer.html" title="interface in org.apache.qpid.proton.codec">WritableBuffer</a>&nbsp;target)</pre>
<div class="block">Copy data from this buffer to the target buffer starting from the current
position and continuing until either this buffer's remaining bytes are
consumed or the target is full.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - The WritableBuffer to transfer this buffer's data to.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this ReadableBuffer instance.</dd>
</dl>
</li>
</ul>
<a name="slice--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>slice</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;slice()</pre>
<div class="block">Creates a new ReadableBuffer instance that is a view of the readable portion of
this buffer. The position will be set to zero and the limit and the reported capacity
will match the value returned by this buffer's <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#remaining--"><code>remaining()</code></a> method, the mark
will be undefined.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new ReadableBuffer that is a view of the readable portion of this buffer.</dd>
</dl>
</li>
</ul>
<a name="flip--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flip</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;flip()</pre>
<div class="block">Sets the buffer limit to the current position and the position is set to zero, the
mark value reset to undefined.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
</dl>
</li>
</ul>
<a name="limit-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>limit</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;limit(int&nbsp;limit)</pre>
<div class="block">Sets the current read limit of this buffer to the given value. If the buffer mark
value is defined and is larger than the limit the mark will be discarded. If the
position is larger than the new limit it will be reset to the new limit.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>limit</code> - The new read limit to set for this buffer.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the limit value is negative or greater than the capacity.</dd>
</dl>
</li>
</ul>
<a name="limit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>limit</h4>
<pre>int&nbsp;limit()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current value of this buffer's limit.</dd>
</dl>
</li>
</ul>
<a name="position-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>position</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;position(int&nbsp;position)</pre>
<div class="block">Sets the current position of this buffer to the given value. If the buffer mark
value is defined and is larger than the newly set position is must be discarded.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>position</code> - The new position to set for this buffer.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the position value is negative or greater than the limit.</dd>
</dl>
</li>
</ul>
<a name="position--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>position</h4>
<pre>int&nbsp;position()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current position from which the next read operation will start.</dd>
</dl>
</li>
</ul>
<a name="mark--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mark</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;mark()</pre>
<div class="block">Mark the current position of this buffer which can be returned to after a
read operation by calling <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html#reset--"><code>reset()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
</dl>
</li>
</ul>
<a name="reset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;reset()</pre>
<div class="block">Reset the buffer's position to a previously marked value, the mark should remain
set after calling this method.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.InvalidMarkException</code> - if the mark value is undefined.</dd>
</dl>
</li>
</ul>
<a name="rewind--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rewind</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;rewind()</pre>
<div class="block">Resets the buffer position to zero and clears and previously set mark.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
</dl>
</li>
</ul>
<a name="clear--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clear</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;clear()</pre>
<div class="block">Resets the buffer position to zero and sets the limit to the buffer capacity,
the mark value is discarded if set.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a reference to this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
</dl>
</li>
</ul>
<a name="remaining--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>remaining</h4>
<pre>int&nbsp;remaining()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the remaining number of readable bytes in this buffer.</dd>
</dl>
</li>
</ul>
<a name="hasRemaining--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasRemaining</h4>
<pre>boolean&nbsp;hasRemaining()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if there are readable bytes still remaining in this buffer.</dd>
</dl>
</li>
</ul>
<a name="duplicate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>duplicate</h4>
<pre><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec">ReadableBuffer</a>&nbsp;duplicate()</pre>
<div class="block">Creates a duplicate <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a> to this instance.
<p>
The duplicated buffer will have the same position, limit and mark as this
buffer. The two buffers share the same backing data.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a duplicate of this <a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.html" title="interface in org.apache.qpid.proton.codec"><code>ReadableBuffer</code></a>.</dd>
</dl>
</li>
</ul>
<a name="byteBuffer--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>byteBuffer</h4>
<pre>java.nio.ByteBuffer&nbsp;byteBuffer()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a ByteBuffer view of the current readable portion of this buffer.</dd>
</dl>
</li>
</ul>
<a name="readUTF8--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readUTF8</h4>
<pre>java.lang.String&nbsp;readUTF8()
throws java.nio.charset.CharacterCodingException</pre>
<div class="block">Reads a UTF-8 encoded String from the buffer starting the decode at the
current position and reading until the limit is reached. The position
is advanced to the limit once this method returns. If there is no bytes
remaining in the buffer when this method is called a null is returned.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string decoded from the remaining bytes in this buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.charset.CharacterCodingException</code> - if the encoding is invalid for any reason.</dd>
</dl>
</li>
</ul>
<a name="readString-java.nio.charset.CharsetDecoder-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>readString</h4>
<pre>java.lang.String&nbsp;readString(java.nio.charset.CharsetDecoder&nbsp;decoder)
throws java.nio.charset.CharacterCodingException</pre>
<div class="block">Decodes a String from the buffer using the provided <code>CharsetDecoder</code>
starting the decode at the current position and reading until the limit is
reached. The position is advanced to the limit once this method returns.
If there is no bytes remaining in the buffer when this method is called a
null is returned.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string decoded from the remaining bytes in this buffer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.nio.charset.CharacterCodingException</code> - if the encoding is invalid for any reason.</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-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/qpid/proton/codec/PrimitiveTypeEncoding.html" title="interface in org.apache.qpid.proton.codec"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/qpid/proton/codec/ReadableBuffer.ByteBufferReader.html" title="class in org.apache.qpid.proton.codec"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/qpid/proton/codec/ReadableBuffer.html" target="_top">Frames</a></li>
<li><a href="ReadableBuffer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>