blob: 630a43724006bf9af07656b9f95ce0afb3978508 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ProtonBuffer (Qpid ProtonJ2 Parent 1.0.0-M19 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.qpid.protonj2.buffer, interface: ProtonBuffer">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/ProtonBuffer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.qpid.protonj2.buffer</a></div>
<h1 title="Interface ProtonBuffer" class="title">Interface ProtonBuffer</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Superinterfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></code>, <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;</code>, <code><a href="ProtonBufferAccessors.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAccessors</a></code>, <code><a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource">Resource</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;</code></dd>
</dl>
<dl class="notes">
<dt>All Known Subinterfaces:</dt>
<dd><code><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></code></dd>
</dl>
<dl class="notes">
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="netty/Netty4ToProtonBufferAdapter.html" title="class in org.apache.qpid.protonj2.buffer.netty">Netty4ToProtonBufferAdapter</a></code>, <code><a href="netty/Netty5ToProtonBufferAdapter.html" title="class in org.apache.qpid.protonj2.buffer.netty">Netty5ToProtonBufferAdapter</a></code>, <code><a href="impl/ProtonByteArrayBuffer.html" title="class in org.apache.qpid.protonj2.buffer.impl">ProtonByteArrayBuffer</a></code>, <code><a href="impl/ProtonCompositeBufferImpl.html" title="class in org.apache.qpid.protonj2.buffer.impl">ProtonCompositeBufferImpl</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">ProtonBuffer</span><span class="extends-implements">
extends <a href="ProtonBufferAccessors.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAccessors</a>, <a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource">Resource</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;</span></div>
<div class="block">Buffer type abstraction used to provide users of the proton library with
a means of using their own type of byte buffer types in combination with the
library tooling.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab5" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab5', 3)" class="table-tab">Default Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#advanceReadOffset(int)" class="member-name-link">advanceReadOffset</a><wbr>(int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Adjusts the current <a href="#getReadOffset()"><code>getReadOffset()</code></a> of this buffer by the specified <code>length</code>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#advanceWriteOffset(int)" class="member-name-link">advanceWriteOffset</a><wbr>(int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Adjusts the current <a href="#getWriteOffset()"><code>getWriteOffset()</code></a> of this buffer by the specified <code>length</code>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#bufferIterator()" class="member-name-link">bufferIterator</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that iterates from the current
read offset and continues until all readable bytes have been traversed.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#bufferIterator(int,int)" class="member-name-link">bufferIterator</a><wbr>(int&nbsp;offset,
int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that iterates from the given
offset and continues until specified number of bytes has been traversed.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#bufferReverseIterator()" class="member-name-link">bufferReverseIterator</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that reverse iterates over the readable
bytes of the source buffer (write offset to read offset).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#bufferReverseIterator(int,int)" class="member-name-link">bufferReverseIterator</a><wbr>(int&nbsp;offset,
int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that reverse iterates from the given
offset and continues until specified number of bytes has been traversed.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#capacity()" class="member-name-link">capacity</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#clear()" class="member-name-link">clear</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Reset the read and write offsets to zero.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#close()" class="member-name-link">close</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Close the buffer and clean up an resources that are held.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#compact()" class="member-name-link">compact</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Moves the readable portion of the buffer to the beginning of the underlying
buffer storage and possibly makes additional bytes available for writes before
a buffer expansion would occur via an <a href="#ensureWritable(int)"><code>ensureWritable(int)</code></a> call.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#compareTo(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">compareTo</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Compares the remaining content of the current buffer with the remaining content of the
given buffer, which must not be null.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBufferComponentAccessor.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferComponentAccessor</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#componentAccessor()" class="member-name-link">componentAccessor</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns a component access object that can be used to gain access to the constituent buffer components
for use in IO operations or other lower level buffer operations that need to work on single compoents.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#componentCount()" class="member-name-link">componentCount</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the number of constituent buffer components that are contained in this buffer instance
which for a non-composite buffer will always be one (namely itself).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#convertToReadOnly()" class="member-name-link">convertToReadOnly</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Converts this buffer instance to a read-only buffer, any write operation that is
performed on this buffer following this call will fail.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#copy()" class="member-name-link">copy</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Create a deep copy of the readable bytes of this ProtonBuffer, the returned buffer can
be modified without affecting the contents or position markers of this instance.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#copy(boolean)" class="member-name-link">copy</a><wbr>(boolean&nbsp;readOnly)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Returns a copy of this buffer's readable bytes and sets the read-only
state of the returned buffer based on the value of the read-only flag.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#copy(int,int)" class="member-name-link">copy</a><wbr>(int&nbsp;index,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Returns a copy of this buffer's sub-region.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#copy(int,int,boolean)" class="member-name-link">copy</a><wbr>(int&nbsp;index,
int&nbsp;length,
boolean&nbsp;readOnly)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns a copy of this buffer's sub-region.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#copyInto(int,byte%5B%5D,int,int)" class="member-name-link">copyInto</a><wbr>(int&nbsp;offset,
byte[]&nbsp;destination,
int&nbsp;destOffset,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Copies the given number of bytes from this buffer into the specified target byte array
starting at the given offset into this buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#copyInto(int,java.nio.ByteBuffer,int,int)" class="member-name-link">copyInto</a><wbr>(int&nbsp;offset,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;destination,
int&nbsp;destOffset,
int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Copies the given number of bytes from this buffer into the specified target <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>
starting at the given offset into this buffer.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#copyInto(int,org.apache.qpid.protonj2.buffer.ProtonBuffer,int,int)" class="member-name-link">copyInto</a><wbr>(int&nbsp;offset,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;destination,
int&nbsp;destOffset,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Copies the given number of bytes from this buffer into the specified target <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a>
starting at the given offset into this buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#ensureWritable(int)" class="member-name-link">ensureWritable</a><wbr>(int&nbsp;amount)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Ensures that the requested number of bytes is available for write operations
in the current buffer, growing the buffer if needed to meet the requested
writable capacity.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#ensureWritable(int,int,boolean)" class="member-name-link">ensureWritable</a><wbr>(int&nbsp;amount,
int&nbsp;minimumGrowth,
boolean&nbsp;allowCompaction)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Ensures that the requested number of bytes is available for write operations
in the current buffer, growing the buffer if needed to meet the requested
writable capacity.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#fill(byte)" class="member-name-link">fill</a><wbr>(byte&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Assigns the given value to every byte in the buffer without respect for the
buffer read or write offsets.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#getReadableBytes()" class="member-name-link">getReadableBytes</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getReadOffset()" class="member-name-link">getReadOffset</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#getWritableBytes()" class="member-name-link">getWritableBytes</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getWriteOffset()" class="member-name-link">getWriteOffset</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#implicitGrowthLimit()" class="member-name-link">implicitGrowthLimit</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the limit assigned to this buffer if one was set which controls how
large the capacity of the buffer can grow implicitly via write calls.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#implicitGrowthLimit(int)" class="member-name-link">implicitGrowthLimit</a><wbr>(int&nbsp;limit)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Configures the limit assigned to this buffer if one was set which controls how
large the capacity of the buffer can grow implicitly via write calls.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#indexOf(byte)" class="member-name-link">indexOf</a><wbr>(byte&nbsp;needle)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Starting from the current read offset into this buffer, find the next offset (index) in the
buffer where the given value is located or <code>-1</code> if the value is not found by the
time the remaining readable bytes has been searched.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#indexOf(byte,int,int)" class="member-name-link">indexOf</a><wbr>(byte&nbsp;needle,
int&nbsp;offset,
int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Starting from the given offset into this buffer, find the next offset (index) in the
buffer where the given value is located or <code>-1</code> if the value is not found by the
time the specified number of bytes has been searched.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isClosed()" class="member-name-link">isClosed</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">A <a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource"><code>Resource</code></a> is closed either following a call to the <a href="../resource/Resource.html#close()"><code>Resource.close()</code></a> method
or by the resource being transfered by way of the <a href="../resource/Resource.html#transfer()"><code>Resource.transfer()</code></a> method.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isComposite()" class="member-name-link">isComposite</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isDirect()" class="member-name-link">isDirect</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#isReadable()" class="member-name-link">isReadable</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#isReadOnly()" class="member-name-link">isReadOnly</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#isWritable()" class="member-name-link">isWritable</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#readableComponentCount()" class="member-name-link">readableComponentCount</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the number of readable constituent buffer components that are contained in this buffer
instance which for a non-composite buffer will always be zero or one (namely itself).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#readBytes(byte%5B%5D,int,int)" class="member-name-link">readBytes</a><wbr>(byte[]&nbsp;destination,
int&nbsp;offset,
int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Read from this buffer, into the destination array, the given number of bytes.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#readBytes(java.nio.ByteBuffer)" class="member-name-link">readBytes</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;destination)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Read from this buffer, into the destination <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> This updates the read offset of this
buffer and also the position of the destination <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#readCharSequence(int,java.nio.charset.Charset)" class="member-name-link">readCharSequence</a><wbr>(int&nbsp;length,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a>&nbsp;charset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Reads a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> of the provided <code>length</code> using the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#readSplit(int)" class="member-name-link">readSplit</a><wbr>(int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Splits this buffer at the read offset + the length given.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setReadOffset(int)" class="member-name-link">setReadOffset</a><wbr>(int&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sets the read offset for this buffer.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setWriteOffset(int)" class="member-name-link">setWriteOffset</a><wbr>(int&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sets the write offset for this buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#split()" class="member-name-link">split</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Splits this buffer at the write offset.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#split(int)" class="member-name-link">split</a><wbr>(int&nbsp;splitOffset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Splits this buffer at the given offset.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#toString(java.nio.charset.Charset)" class="member-name-link">toString</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a>&nbsp;charset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Returns a String created from the buffer's underlying bytes using the specified
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a> for the newly created String.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#transferFrom(java.nio.channels.FileChannel,long,int)" class="member-name-link">transferFrom</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/channels/FileChannel.html" title="class or interface in java.nio.channels" class="external-link">FileChannel</a>&nbsp;channel,
long&nbsp;position,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Reads a sequence of bytes from the given channel into this buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#transferFrom(java.nio.channels.ReadableByteChannel,int)" class="member-name-link">transferFrom</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/channels/ReadableByteChannel.html" title="class or interface in java.nio.channels" class="external-link">ReadableByteChannel</a>&nbsp;channel,
int&nbsp;length)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Reads a sequence of bytes from the given channel into this buffer.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#transferTo(java.nio.channels.WritableByteChannel,int)" class="member-name-link">transferTo</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/channels/WritableByteChannel.html" title="class or interface in java.nio.channels" class="external-link">WritableByteChannel</a>&nbsp;channel,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Read from this buffer and write to the given channel.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#unwrap()" class="member-name-link">unwrap</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Return the underlying buffer object that backs this <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instance, or self
if there is no backing object.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#writableComponentCount()" class="member-name-link">writableComponentCount</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the number of writable constituent buffer components that are contained in this buffer
instance which for a non-composite buffer will always be zero or one (namely itself).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#writeBytes(byte%5B%5D)" class="member-name-link">writeBytes</a><wbr>(byte[]&nbsp;source)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Writes into this buffer, all the bytes from the given byte array.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#writeBytes(byte%5B%5D,int,int)" class="member-name-link">writeBytes</a><wbr>(byte[]&nbsp;source,
int&nbsp;offset,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Writes into this buffer, the given number of bytes from the byte array.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#writeBytes(java.nio.ByteBuffer)" class="member-name-link">writeBytes</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;source)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Writes into this buffer from the source <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#writeBytes(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">writeBytes</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;source)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Writes into this buffer, all the readable bytes from the given buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#writeCharSequence(java.lang.CharSequence,java.nio.charset.Charset)" class="member-name-link">writeCharSequence</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a>&nbsp;source,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a>&nbsp;charset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Writes into this buffer, all the bytes from the given <code>source</code> using the passed
<code>charset</code>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#writeSplit(int)" class="member-name-link">writeSplit</a><wbr>(int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Splits this buffer at the write offset + the length given.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.qpid.protonj2.buffer.ProtonBufferAccessors">Methods inherited from interface&nbsp;org.apache.qpid.protonj2.buffer.<a href="ProtonBufferAccessors.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAccessors</a></h3>
<code><a href="ProtonBufferAccessors.html#getBoolean(int)">getBoolean</a>, <a href="ProtonBufferAccessors.html#getByte(int)">getByte</a>, <a href="ProtonBufferAccessors.html#getChar(int)">getChar</a>, <a href="ProtonBufferAccessors.html#getDouble(int)">getDouble</a>, <a href="ProtonBufferAccessors.html#getFloat(int)">getFloat</a>, <a href="ProtonBufferAccessors.html#getInt(int)">getInt</a>, <a href="ProtonBufferAccessors.html#getLong(int)">getLong</a>, <a href="ProtonBufferAccessors.html#getShort(int)">getShort</a>, <a href="ProtonBufferAccessors.html#getUnsignedByte(int)">getUnsignedByte</a>, <a href="ProtonBufferAccessors.html#getUnsignedInt(int)">getUnsignedInt</a>, <a href="ProtonBufferAccessors.html#getUnsignedShort(int)">getUnsignedShort</a>, <a href="ProtonBufferAccessors.html#readBoolean()">readBoolean</a>, <a href="ProtonBufferAccessors.html#readByte()">readByte</a>, <a href="ProtonBufferAccessors.html#readChar()">readChar</a>, <a href="ProtonBufferAccessors.html#readDouble()">readDouble</a>, <a href="ProtonBufferAccessors.html#readFloat()">readFloat</a>, <a href="ProtonBufferAccessors.html#readInt()">readInt</a>, <a href="ProtonBufferAccessors.html#readLong()">readLong</a>, <a href="ProtonBufferAccessors.html#readShort()">readShort</a>, <a href="ProtonBufferAccessors.html#readUnsignedByte()">readUnsignedByte</a>, <a href="ProtonBufferAccessors.html#readUnsignedInt()">readUnsignedInt</a>, <a href="ProtonBufferAccessors.html#readUnsignedShort()">readUnsignedShort</a>, <a href="ProtonBufferAccessors.html#setBoolean(int,boolean)">setBoolean</a>, <a href="ProtonBufferAccessors.html#setByte(int,byte)">setByte</a>, <a href="ProtonBufferAccessors.html#setChar(int,char)">setChar</a>, <a href="ProtonBufferAccessors.html#setDouble(int,double)">setDouble</a>, <a href="ProtonBufferAccessors.html#setFloat(int,float)">setFloat</a>, <a href="ProtonBufferAccessors.html#setInt(int,int)">setInt</a>, <a href="ProtonBufferAccessors.html#setLong(int,long)">setLong</a>, <a href="ProtonBufferAccessors.html#setShort(int,short)">setShort</a>, <a href="ProtonBufferAccessors.html#setUnsignedByte(int,int)">setUnsignedByte</a>, <a href="ProtonBufferAccessors.html#setUnsignedInt(int,long)">setUnsignedInt</a>, <a href="ProtonBufferAccessors.html#setUnsignedShort(int,int)">setUnsignedShort</a>, <a href="ProtonBufferAccessors.html#writeBoolean(boolean)">writeBoolean</a>, <a href="ProtonBufferAccessors.html#writeByte(byte)">writeByte</a>, <a href="ProtonBufferAccessors.html#writeChar(char)">writeChar</a>, <a href="ProtonBufferAccessors.html#writeDouble(double)">writeDouble</a>, <a href="ProtonBufferAccessors.html#writeFloat(float)">writeFloat</a>, <a href="ProtonBufferAccessors.html#writeInt(int)">writeInt</a>, <a href="ProtonBufferAccessors.html#writeLong(long)">writeLong</a>, <a href="ProtonBufferAccessors.html#writeShort(short)">writeShort</a>, <a href="ProtonBufferAccessors.html#writeUnsignedByte(int)">writeUnsignedByte</a>, <a href="ProtonBufferAccessors.html#writeUnsignedInt(long)">writeUnsignedInt</a>, <a href="ProtonBufferAccessors.html#writeUnsignedShort(int)">writeUnsignedShort</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.qpid.protonj2.resource.Resource">Methods inherited from interface&nbsp;org.apache.qpid.protonj2.resource.<a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource">Resource</a></h3>
<code><a href="../resource/Resource.html#transfer()">transfer</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="close()">
<h3>close</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">close</span>()</div>
<div class="block">Close the buffer and clean up an resources that are held. The buffer close
must not throw an exception.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/AutoCloseable.html#close()" title="class or interface in java.lang" class="external-link">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></code></dd>
<dt>Specified by:</dt>
<dd><code><a href="../resource/Resource.html#close()">close</a></code>&nbsp;in interface&nbsp;<code><a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource">Resource</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;</code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isDirect()">
<h3>isDirect</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">isDirect</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>true if the buffer is backed by native memory.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unwrap()">
<h3>unwrap</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span>&nbsp;<span class="element-name">unwrap</span>()</div>
<div class="block">Return the underlying buffer object that backs this <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instance, or self
if there is no backing object.
This method should be overridden in buffer abstraction when access to the underlying backing
store is needed such as when wrapping pooled resources that need explicit release calls.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>an underlying buffer object or other backing store for this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="convertToReadOnly()">
<h3>convertToReadOnly</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">convertToReadOnly</span>()</div>
<div class="block">Converts this buffer instance to a read-only buffer, any write operation that is
performed on this buffer following this call will fail. A buffer cannot be made
writable after this call.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>this buffer for use in chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isReadOnly()">
<h3>isReadOnly</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">isReadOnly</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>whether this buffer instance is read-only or not.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isClosed()">
<h3>isClosed</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">isClosed</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../resource/Resource.html#isClosed()">Resource</a></code></span></div>
<div class="block">A <a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource"><code>Resource</code></a> is closed either following a call to the <a href="../resource/Resource.html#close()"><code>Resource.close()</code></a> method
or by the resource being transfered by way of the <a href="../resource/Resource.html#transfer()"><code>Resource.transfer()</code></a> method.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../resource/Resource.html#isClosed()">isClosed</a></code>&nbsp;in interface&nbsp;<code><a href="../resource/Resource.html" title="interface in org.apache.qpid.protonj2.resource">Resource</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;</code></dd>
<dt>Returns:</dt>
<dd>if this buffer has been closed and can no longer be accessed for reads or writes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getReadableBytes()">
<h3>getReadableBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getReadableBytes</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of bytes available for reading from this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getReadOffset()">
<h3>getReadOffset</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">getReadOffset</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the current value of the read offset for this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setReadOffset(int)">
<h3>setReadOffset</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">setReadOffset</span><wbr><span class="parameters">(int&nbsp;value)</span></div>
<div class="block">Sets the read offset for this buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The offset into the buffer where the read offset should be positioned.</dd>
<dt>Returns:</dt>
<dd>this buffer for use in chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the value given is greater than the write offset or negative.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="advanceReadOffset(int)">
<h3>advanceReadOffset</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">advanceReadOffset</span><wbr><span class="parameters">(int&nbsp;length)</span></div>
<div class="block">Adjusts the current <a href="#getReadOffset()"><code>getReadOffset()</code></a> of this buffer by the specified <code>length</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - the number of bytes to advance the read offset by.</dd>
<dt>Returns:</dt>
<dd>this ProtonBuffer for chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the {#code length} given is negative.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if <code>length</code> is greater than <code>this.readableBytes</code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isReadable()">
<h3>isReadable</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isReadable</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>true if the read index is less than the write index.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getWritableBytes()">
<h3>getWritableBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getWritableBytes</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of bytes that can be written to this buffer before the limit is hit.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getWriteOffset()">
<h3>getWriteOffset</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">getWriteOffset</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the current value of the write offset for this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setWriteOffset(int)">
<h3>setWriteOffset</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">setWriteOffset</span><wbr><span class="parameters">(int&nbsp;value)</span></div>
<div class="block">Sets the write offset for this buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The offset into the buffer where the write offset should be positioned.</dd>
<dt>Returns:</dt>
<dd>this buffer for use in chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the value less than the read offset or greater than the capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="advanceWriteOffset(int)">
<h3>advanceWriteOffset</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">advanceWriteOffset</span><wbr><span class="parameters">(int&nbsp;length)</span></div>
<div class="block">Adjusts the current <a href="#getWriteOffset()"><code>getWriteOffset()</code></a> of this buffer by the specified <code>length</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - the number of bytes to advance the write offset by.</dd>
<dt>Returns:</dt>
<dd>this ProtonBuffer for chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the {#code length} given is negative.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if <code>length</code> is greater than the buffer <a href="#capacity()"><code>capacity()</code></a></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isWritable()">
<h3>isWritable</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isWritable</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>true if the buffer has bytes remaining between the write offset and the capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="fill(byte)">
<h3>fill</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">fill</span><wbr><span class="parameters">(byte&nbsp;value)</span></div>
<div class="block">Assigns the given value to every byte in the buffer without respect for the
buffer read or write offsets.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The byte value to assign each byte in this buffer.</dd>
<dt>Returns:</dt>
<dd>this ProtonBuffer for chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="capacity()">
<h3>capacity</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">capacity</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of bytes this buffer can currently contain.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="implicitGrowthLimit()">
<h3>implicitGrowthLimit</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">implicitGrowthLimit</span>()</div>
<div class="block">Returns the limit assigned to this buffer if one was set which controls how
large the capacity of the buffer can grow implicitly via write calls. Once
the limit is hit any write call that requires more capacity than is currently
available will throw an exception instead of allocating more space.
<p>
When a capacity limit is hit the buffer can still be enlarged but must be
done explicitly via the ensure writable APIs.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of bytes this buffer can currently grow to..</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="implicitGrowthLimit(int)">
<h3>implicitGrowthLimit</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">implicitGrowthLimit</span><wbr><span class="parameters">(int&nbsp;limit)</span></div>
<div class="block">Configures the limit assigned to this buffer if one was set which controls how
large the capacity of the buffer can grow implicitly via write calls. Once
the limit is hit any write call that requires more capacity than is currently
available will throw an exception instead of allocating more space.
<p>
When a capacity limit is hit the buffer can still be enlarged but must be
done explicitly via the ensure writable APIs.
<p>
The growth limit set applies only to this buffer instance and is not carried
over to a copied buffer of the split buffer created from any of the buffer
split calls.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>limit</code> - The limit to assign as the maximum capacity this buffer can grow</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ensureWritable(int)">
<h3>ensureWritable</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">ensureWritable</span><wbr><span class="parameters">(int&nbsp;amount)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a>,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Ensures that the requested number of bytes is available for write operations
in the current buffer, growing the buffer if needed to meet the requested
writable capacity. This method will not alter the write offset but may change
the value returned from the capacity method if new buffer space is allocated.
<p>
This method allows buffer compaction as a strategy to reclaim already read
space to make room for additional writes. This implies that a composite buffer
can reuse already read buffers to extend the buffer's writable space by moving
them to the end of the set of composite buffers and reseting their index values
to make them fully writable.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>amount</code> - The number of bytes beyond the current write index needed.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the amount given is less than zero.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the amount given would result in the buffer
exceeding the maximum capacity for this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ensureWritable(int,int,boolean)">
<h3>ensureWritable</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">ensureWritable</span><wbr><span class="parameters">(int&nbsp;amount,
int&nbsp;minimumGrowth,
boolean&nbsp;allowCompaction)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a>,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Ensures that the requested number of bytes is available for write operations
in the current buffer, growing the buffer if needed to meet the requested
writable capacity. This method will not alter the write offset but may change
the value returned from the capacity method if new buffer space is allocated.
If the buffer cannot create the required number of byte via compaction then
the buffer will be grown by either the requested number of bytes or by the
minimum allowed value specified.
<p>
This method allows buffer compaction as a strategy to reclaim already read
space to make room for additional writes. This implies that a composite buffer
can reuse already read buffers to extend the buffer's writable space by moving
them to the end of the set of composite buffers and reseting their index values
to make them fully writable.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>amount</code> - The number of bytes beyond the current write index needed.</dd>
<dd><code>minimumGrowth</code> - The minimum number of byte that the buffer can grow by</dd>
<dd><code>allowCompaction</code> - Can the buffer use compaction as a strategy to create more writable space.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the amount given is less than zero.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the amount given would result in the buffer
exceeding the maximum capacity for this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy()">
<h3>copy</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">copy</span>()</div>
<div class="block">Create a deep copy of the readable bytes of this ProtonBuffer, the returned buffer can
be modified without affecting the contents or position markers of this instance. The
returned copy will not be read-only regardless of the read-only state of this buffer
instance at the time of copy.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a deep copy of this ProtonBuffer instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy(int,int)">
<h3>copy</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">copy</span><wbr><span class="parameters">(int&nbsp;index,
int&nbsp;length)</span></div>
<div class="block">Returns a copy of this buffer's sub-region. Modifying the content of
the returned buffer or this buffer does not affect each other at all.
This method does not modify the value returned from <a href="#getReadOffset()"><code>getReadOffset()</code></a>
or <a href="#getWriteOffset()"><code>getWriteOffset()</code></a> of this buffer.
<p>
The returned buffer will not be read-only even if this buffer is and
as such the contents will be a deep copy regardless of this buffer's
read-only state.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - The index in this buffer where the copy should begin</dd>
<dd><code>length</code> - The number of bytes to copy to the new buffer from this one.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance containing the copied bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy(boolean)">
<h3>copy</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">copy</span><wbr><span class="parameters">(boolean&nbsp;readOnly)</span></div>
<div class="block">Returns a copy of this buffer's readable bytes and sets the read-only
state of the returned buffer based on the value of the read-only flag.
If this buffer is read-only and the flag indicates a read-only copy
then the copy may be a shallow copy that references the readable
bytes of the source buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>readOnly</code> - Should the returned buffer be read-only or not.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance containing the copied bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy(int,int,boolean)">
<h3>copy</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">copy</span><wbr><span class="parameters">(int&nbsp;index,
int&nbsp;length,
boolean&nbsp;readOnly)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
<div class="block">Returns a copy of this buffer's sub-region. Modifying the content of
the returned buffer or this buffer does not affect each other at all.
This method does not modify the value returned from <a href="#getReadOffset()"><code>getReadOffset()</code></a>
or <a href="#getWriteOffset()"><code>getWriteOffset()</code></a> of this buffer.
<p>
If this buffer is read-only and the requested copy is also read-only the
copy may be shallow and allow each buffer to share the same memory.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - The index in this buffer where the copy should begin</dd>
<dd><code>length</code> - The number of bytes to copy to the new buffer from this one.</dd>
<dd><code>readOnly</code> - Should the returned buffer be read-only or not.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance containing the copied bytes.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the offset or length given are out of bounds.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="clear()">
<h3>clear</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">clear</span>()</div>
<div class="block">Reset the read and write offsets to zero.
<p>
This method is not required to reset the data previously written to this buffer.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="compact()">
<h3>compact</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">compact</span>()</div>
<div class="block">Moves the readable portion of the buffer to the beginning of the underlying
buffer storage and possibly makes additional bytes available for writes before
a buffer expansion would occur via an <a href="#ensureWritable(int)"><code>ensureWritable(int)</code></a> call.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readSplit(int)">
<h3>readSplit</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">readSplit</span><wbr><span class="parameters">(int&nbsp;length)</span></div>
<div class="block">Splits this buffer at the read offset + the length given.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - The number of bytes beyond the read offset where the split should occur</dd>
<dt>Returns:</dt>
<dd>A new buffer that owns the memory spanning the range given.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeSplit(int)">
<h3>writeSplit</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">writeSplit</span><wbr><span class="parameters">(int&nbsp;length)</span></div>
<div class="block">Splits this buffer at the write offset + the length given.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - The number of bytes beyond the write offset where the split should occur</dd>
<dt>Returns:</dt>
<dd>A new buffer that owns the memory spanning the range given.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="split()">
<h3>split</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">split</span>()</div>
<div class="block">Splits this buffer at the write offset.
<p>
This creates two independent buffers that can manage differing views of the same
memory region or in the case of a composite buffer two buffers that take ownership
of differing sections of the composite buffer range. For a composite buffer a single
buffer might be split if the offset lays within its bounds but all others buffers
are divided amongst the two split buffers.
<p>
If this buffer is a read-only buffer then the resulting split buffer will also be
read-only.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>A new buffer that owns the memory spanning the range given.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="split(int)">
<h3>split</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">split</span><wbr><span class="parameters">(int&nbsp;splitOffset)</span></div>
<div class="block">Splits this buffer at the given offset.
<p>
This creates two independent buffers that can manage differing views of the same
memory region or in the case of a composite buffer two buffers that take ownership
of differing sections of the composite buffer range. For a composite buffer a single
buffer might be split if the offset lays within its bounds but all others buffers
are divided amongst the two split buffers.
<p>
If this buffer is a read-only buffer then the resulting split buffer will also be
read-only.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>splitOffset</code> - The offset in this buffer where the split should occur.</dd>
<dt>Returns:</dt>
<dd>A new buffer that owns the memory spanning the range given.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString(java.nio.charset.Charset)">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a>&nbsp;charset)</span></div>
<div class="block">Returns a String created from the buffer's underlying bytes using the specified
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a> for the newly created String.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>charset</code> - the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a> to use to construct the new string.</dd>
<dt>Returns:</dt>
<dd>a string created from the buffer's underlying bytes using the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="compareTo(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>compareTo</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">compareTo</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer)</span></div>
<div class="block">Compares the remaining content of the current buffer with the remaining content of the
given buffer, which must not be null. Each byte is compared in turn as an unsigned value,
returning upon the first difference. If no difference is found before the end of one
buffer, the shorter buffer is considered less than the other, or else if the same length
then they are considered equal.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html#compareTo(T)" title="class or interface in java.lang" class="external-link">compareTo</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&gt;</code></dd>
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer to compare to this instance.</dd>
<dt>Returns:</dt>
<dd>a negative, zero, or positive integer when this buffer is less than, equal to,
or greater than the given buffer.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html#compareTo(T)" title="class or interface in java.lang" class="external-link"><code>Comparable.compareTo(Object)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeCharSequence(java.lang.CharSequence,java.nio.charset.Charset)">
<h3>writeCharSequence</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">writeCharSequence</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a>&nbsp;source,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a>&nbsp;charset)</span></div>
<div class="block">Writes into this buffer, all the bytes from the given <code>source</code> using the passed
<code>charset</code>. This updates the <a href="#getWriteOffset()">write offset</a> of this buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> to read the bytes from.</dd>
<dd><code>charset</code> - The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a> to use for encoding the bytes that will be written.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readCharSequence(int,java.nio.charset.Charset)">
<h3>readCharSequence</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a></span>&nbsp;<span class="element-name">readCharSequence</span><wbr><span class="parameters">(int&nbsp;length,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link">Charset</a>&nbsp;charset)</span></div>
<div class="block">Reads a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> of the provided <code>length</code> using the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html" title="class or interface in java.nio.charset" class="external-link"><code>Charset</code></a>.
This advances the <a href="#getReadOffset()">getReadOffset()</a> reader offset} of this buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - The number of bytes to read to create the resulting <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a>.</dd>
<dd><code>charset</code> - The Charset of the bytes to be read and decoded into the resulting <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a>.</dd>
<dt>Returns:</dt>
<dd><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> read and decoded from bytes in this buffer.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the passed <code>length</code> is more than the <a href="#getReadableBytes()">getReadableBytes()</a> of
this buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copyInto(int,byte[],int,int)">
<h3>copyInto</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">copyInto</span><wbr><span class="parameters">(int&nbsp;offset,
byte[]&nbsp;destination,
int&nbsp;destOffset,
int&nbsp;length)</span></div>
<div class="block">Copies the given number of bytes from this buffer into the specified target byte array
starting at the given offset into this buffer. The copied region is written into the
target starting at the given offset and continues for the specified length of elements.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - The offset into this buffer where the copy begins from.</dd>
<dd><code>destination</code> - The destination byte array where the copied bytes are written.</dd>
<dd><code>destOffset</code> - The offset into the destination to begin writing the copied bytes.</dd>
<dd><code>length</code> - The number of bytes to copy into the destination.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the destination array is null.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the source or destination positions, or the length, are negative,
or if the resulting end positions reaches beyond the end of either this buffer, or the destination array.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - if this buffer has already been closed.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copyInto(int,java.nio.ByteBuffer,int,int)">
<h3>copyInto</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">copyInto</span><wbr><span class="parameters">(int&nbsp;offset,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;destination,
int&nbsp;destOffset,
int&nbsp;length)</span></div>
<div class="block">Copies the given number of bytes from this buffer into the specified target <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>
starting at the given offset into this buffer. The copied region is written into the
target starting at the given offset and continues for the specified length of elements.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - The offset into this buffer where the copy begins from.</dd>
<dd><code>destination</code> - The destination <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> where the copied bytes are written.</dd>
<dd><code>destOffset</code> - The offset into the destination to begin writing the copied bytes.</dd>
<dd><code>length</code> - The number of bytes to copy into the destination.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the destination buffer is null.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the source or destination positions, or the length, are negative,
or if the resulting end positions reaches beyond the end of either this buffer, or the destination buffer.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - if this buffer has already been closed.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copyInto(int,org.apache.qpid.protonj2.buffer.ProtonBuffer,int,int)">
<h3>copyInto</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">copyInto</span><wbr><span class="parameters">(int&nbsp;offset,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;destination,
int&nbsp;destOffset,
int&nbsp;length)</span></div>
<div class="block">Copies the given number of bytes from this buffer into the specified target <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a>
starting at the given offset into this buffer. The copied region is written into the
target starting at the given offset and continues for the specified length of elements.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - The offset into this buffer where the copy begins from.</dd>
<dd><code>destination</code> - The destination <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> where the copied bytes are written.</dd>
<dd><code>destOffset</code> - The offset into the destination to begin writing the copied bytes.</dd>
<dd><code>length</code> - The number of bytes to copy into the destination.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the destination buffer is null.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the source or destination positions, or the length, are negative,
or if the resulting end positions reaches beyond the end of either this buffer, or the destination buffer.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - if this buffer has already been closed.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeBytes(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>writeBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">writeBytes</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;source)</span></div>
<div class="block">Writes into this buffer, all the readable bytes from the given buffer. This updates the
<a href="#getWriteOffset()"><code>getWriteOffset()</code></a> of this buffer, and the <a href="#getReadOffset()"><code>getReadOffset()</code></a> of the given buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The buffer to read from.</dd>
<dt>Returns:</dt>
<dd>This buffer.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - If the source buffer is <code>null</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeBytes(byte[])">
<h3>writeBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">writeBytes</span><wbr><span class="parameters">(byte[]&nbsp;source)</span></div>
<div class="block">Writes into this buffer, all the bytes from the given byte array. This updates the
<a href="#getWriteOffset()">getWriteOffset()</a> of this buffer by the length of the array.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The byte array to read from.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeBytes(byte[],int,int)">
<h3>writeBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">writeBytes</span><wbr><span class="parameters">(byte[]&nbsp;source,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Writes into this buffer, the given number of bytes from the byte array. This updates the
<a href="#getWriteOffset()">getWriteOffset()</a> of this buffer by the length argument. Implementations are
recommended to specialize this method and provide a more efficient version.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The byte array to read from.</dd>
<dd><code>offset</code> - The position in the <code>source</code> from where bytes should be written to this buffer.</dd>
<dd><code>length</code> - The number of bytes to copy.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeBytes(java.nio.ByteBuffer)">
<h3>writeBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">writeBytes</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;source)</span></div>
<div class="block">Writes into this buffer from the source <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>. This updates the
<a href="#getWriteOffset()"><code>getWriteOffset()</code></a> of this buffer and also the position of the source
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>. Implementations are recommended to specialize this method
and provide a more efficient version.
<p>
Note: the behavior is undefined if the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> is an alias for the memory in this buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> to read from.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readBytes(java.nio.ByteBuffer)">
<h3>readBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">readBytes</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;destination)</span></div>
<div class="block">Read from this buffer, into the destination <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> This updates the read offset of this
buffer and also the position of the destination <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a>.
<p>
Note: the behavior is undefined if the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> is an alias for the memory in this buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>destination</code> - The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> to write into.</dd>
<dt>Returns:</dt>
<dd>this buffer for using in call chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readBytes(byte[],int,int)">
<h3>readBytes</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a></span>&nbsp;<span class="element-name">readBytes</span><wbr><span class="parameters">(byte[]&nbsp;destination,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Read from this buffer, into the destination array, the given number of bytes.
This updates the read offset of this buffer by the length argument.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>destination</code> - The byte array to write into.</dd>
<dd><code>offset</code> - Position in the <code>destination</code> to where bytes should be written from this buffer.</dd>
<dd><code>length</code> - The number of bytes to copy.</dd>
<dt>Returns:</dt>
<dd>This buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="transferTo(java.nio.channels.WritableByteChannel,int)">
<h3>transferTo</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">transferTo</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/channels/WritableByteChannel.html" title="class or interface in java.nio.channels" class="external-link">WritableByteChannel</a>&nbsp;channel,
int&nbsp;length)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Read from this buffer and write to the given channel.
<p>
The number of bytes actually written to the channel are returned. No more than the given <code>length</code>
of bytes, or the number of <a href="#getReadableBytes()">readable bytes</a>, will be written to the channel,
whichever is smaller. A channel that has a position marker, will be advanced by the number of bytes written.
The <a href="#getReadOffset()">read offset</a> of this buffer will also be advanced by the number of bytes
written.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>channel</code> - The channel to write to.</dd>
<dd><code>length</code> - The maximum number of bytes to write.</dd>
<dt>Returns:</dt>
<dd>The actual number of bytes written, possibly zero.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - If the write-operation on the channel failed for some reason.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="transferFrom(java.nio.channels.ReadableByteChannel,int)">
<h3>transferFrom</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">transferFrom</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/channels/ReadableByteChannel.html" title="class or interface in java.nio.channels" class="external-link">ReadableByteChannel</a>&nbsp;channel,
int&nbsp;length)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Reads a sequence of bytes from the given channel into this buffer.
<p>
The method reads a given amount of bytes from the provided channel and returns the number of
bytes actually read which can be zero or -1 if the channel has reached the end of stream state.
<p>
The length value given is a maximum limit however the code will adjust this if the number
of writable bytes in this buffer is smaller (or zero) and the result will indicate how many
bytes where actually read. The write offset of this buffer will be advanced by the number
of bytes read from the buffer as will the channel position index if one exists.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>channel</code> - The readable byte channel where the bytes are read</dd>
<dd><code>length</code> - The maximum number of bytes to read from the channel</dd>
<dt>Returns:</dt>
<dd>The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if the read operation fails</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="transferFrom(java.nio.channels.FileChannel,long,int)">
<h3>transferFrom</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">transferFrom</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/channels/FileChannel.html" title="class or interface in java.nio.channels" class="external-link">FileChannel</a>&nbsp;channel,
long&nbsp;position,
int&nbsp;length)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Reads a sequence of bytes from the given channel into this buffer.
<p>
The method reads a given amount of bytes from the provided channel and returns the number of
bytes actually read which can be zero or -1 if the channel has reached the end of stream state.
<p>
The length value given is a maximum limit however the code will adjust this if the number
of writable bytes in this buffer is smaller (or zero) and the result will indicate how many
bytes where actually read. The write offset of this buffer will be advanced by the number
of bytes read from the buffer, the channel will not have its position modified.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>channel</code> - The File channel where the bytes are read</dd>
<dd><code>position</code> - The position in the channel where the read should begin</dd>
<dd><code>length</code> - The maximum number of bytes to read from the channel</dd>
<dt>Returns:</dt>
<dd>The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if the read operation fails</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isComposite()">
<h3>isComposite</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">isComposite</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>true if the buffer is backed by one or more <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="componentCount()">
<h3>componentCount</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">componentCount</span>()</div>
<div class="block">Returns the number of constituent buffer components that are contained in this buffer instance
which for a non-composite buffer will always be one (namely itself). For a composite buffer this
count is the total count of all buffers mapped to the composite.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of buffers managed by this <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readableComponentCount()">
<h3>readableComponentCount</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">readableComponentCount</span>()</div>
<div class="block">Returns the number of readable constituent buffer components that are contained in this buffer
instance which for a non-composite buffer will always be zero or one (namely itself). For a composite
buffer this count is the total count of all buffers mapped to the composite which are readable.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of readable buffers managed by this <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writableComponentCount()">
<h3>writableComponentCount</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">writableComponentCount</span>()</div>
<div class="block">Returns the number of writable constituent buffer components that are contained in this buffer
instance which for a non-composite buffer will always be zero or one (namely itself). For a composite
buffer this count is the total count of all buffers mapped to the composite which are writable.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of writable buffer components managed by this <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="componentAccessor()">
<h3>componentAccessor</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBufferComponentAccessor.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferComponentAccessor</a></span>&nbsp;<span class="element-name">componentAccessor</span>()</div>
<div class="block">Returns a component access object that can be used to gain access to the constituent buffer components
for use in IO operations or other lower level buffer operations that need to work on single compoents.
<p>
The general usage of the component access object should be within a try-with-resource
block as follows:
<pre><code>
try (ProtonBufferComponentAccessor accessor = buffer.componentAccessor()) {
for (ProtonBufferComponent component : accessor.readableComponents()) {
// Access logic here....
}
}
</code></pre></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a component access object instance used to view the buffer internal components</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="bufferIterator()">
<h3>bufferIterator</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></span>&nbsp;<span class="element-name">bufferIterator</span>()</div>
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that iterates from the current
read offset and continues until all readable bytes have been traversed. The source buffer
read and write offsets are not modified by an iterator instance.
<p>
The caller must ensure that the source buffer lifetime extends beyond the lifetime of
the returned <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a new buffer iterator that iterates over the readable bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="bufferIterator(int,int)">
<h3>bufferIterator</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></span>&nbsp;<span class="element-name">bufferIterator</span><wbr><span class="parameters">(int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that iterates from the given
offset and continues until specified number of bytes has been traversed. The source buffer
read and write offsets are not modified by an iterator instance.
<p>
The caller must ensure that the source buffer lifetime extends beyond the lifetime of
the returned <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - The offset into the buffer where iteration begins</dd>
<dd><code>length</code> - The number of bytes to iterate over.</dd>
<dt>Returns:</dt>
<dd>a new buffer iterator that iterates over the readable bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="bufferReverseIterator()">
<h3>bufferReverseIterator</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></span>&nbsp;<span class="element-name">bufferReverseIterator</span>()</div>
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that reverse iterates over the readable
bytes of the source buffer (write offset to read offset). The source buffer read and write offsets
are not modified by an iterator instance.
<p>
The caller must ensure that the source buffer lifetime extends beyond the lifetime of
the returned <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a new buffer iterator that iterates over the readable bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="bufferReverseIterator(int,int)">
<h3>bufferReverseIterator</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferIterator</a></span>&nbsp;<span class="element-name">bufferReverseIterator</span><wbr><span class="parameters">(int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Creates and returns a new <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a> that reverse iterates from the given
offset and continues until specified number of bytes has been traversed. The source buffer
read and write offsets are not modified by an iterator instance.
<p>
The caller must ensure that the source buffer lifetime extends beyond the lifetime of
the returned <a href="ProtonBufferIterator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferIterator</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - The offset into the buffer where iteration begins</dd>
<dd><code>length</code> - The number of bytes to iterate over.</dd>
<dt>Returns:</dt>
<dd>a new buffer iterator that iterates over the readable bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="indexOf(byte)">
<h3>indexOf</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">indexOf</span><wbr><span class="parameters">(byte&nbsp;needle)</span></div>
<div class="block">Starting from the current read offset into this buffer, find the next offset (index) in the
buffer where the given value is located or <code>-1</code> if the value is not found by the
time the remaining readable bytes has been searched. This method does not affect the read or
write offset and can be called from any point in the buffer regardless of the current read or
write offsets.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>needle</code> - The byte value to search for in the remaining buffer bytes.</dd>
<dt>Returns:</dt>
<dd>the location in the buffer where the value was found or <code>-1</code> if not found.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="indexOf(byte,int,int)">
<h3>indexOf</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">indexOf</span><wbr><span class="parameters">(byte&nbsp;needle,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Starting from the given offset into this buffer, find the next offset (index) in the
buffer where the given value is located or <code>-1</code> if the value is not found by the
time the specified number of bytes has been searched. This method does not affect the read or
write offset and can be called from any point in the buffer regardless of the current read or
write offsets. The search bounds are that of the buffer's readable bytes meaning that the
starting office cannot be less than the read offset and the length cannot cause the search
to read past the readable bytes otherwise an <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link"><code>IndexOutOfBoundsException</code></a> will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>needle</code> - The byte value to search for in the remaining buffer bytes.</dd>
<dd><code>offset</code> - The offset into the buffer where the search should begin from.</dd>
<dd><code>length</code> - The offset into the buffer where the search should begin from.</dd>
<dt>Returns:</dt>
<dd>the location in the buffer where the value was found or <code>-1</code> if not found.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2024 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>