blob: 9f1ed9c5d73344ac9b4d20038844736b92cf7ed8 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ProtonBufferAllocator (Qpid ProtonJ2 Parent 1.0.0-M18 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: ProtonBufferAllocator">
<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/ProtonBufferAllocator.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 ProtonBufferAllocator" class="title">Interface ProtonBufferAllocator</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></dd>
</dl>
<dl class="notes">
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="netty/Netty4ProtonBufferAllocator.html" title="class in org.apache.qpid.protonj2.buffer.netty">Netty4ProtonBufferAllocator</a></code>, <code><a href="netty/Netty5ProtonBufferAllocator.html" title="class in org.apache.qpid.protonj2.buffer.netty">Netty5ProtonBufferAllocator</a></code>, <code><a href="impl/ProtonByteArrayBufferAllocator.html" title="class in org.apache.qpid.protonj2.buffer.impl">ProtonByteArrayBufferAllocator</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">ProtonBufferAllocator</span><span class="extends-implements">
extends <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></span></div>
<div class="block">Interface for a ProtonBuffer allocator object that can be used by Proton
objects to create memory buffers using the preferred type of the application
or library that embeds the Proton engine.</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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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-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="#allocate()" class="member-name-link">allocate</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Create a new ProtonBuffer instance with default initial 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="#allocate(int)" class="member-name-link">allocate</a><wbr>(int&nbsp;initialCapacity)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Create a new ProtonBuffer instance with the given initial capacity and the
implicit growth limit should be that of the underlying buffer implementations
maximum capacity limit.</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="#allocateHeapBuffer()" class="member-name-link">allocateHeapBuffer</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Create a new ProtonBuffer instance with default initial 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="#allocateHeapBuffer(int)" class="member-name-link">allocateHeapBuffer</a><wbr>(int&nbsp;initialCapacity)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Create a new ProtonBuffer instance with the given initial capacity and the
implicit growth limit should be that of the underlying buffer implementations
maximum capacity limit.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><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-tab5">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#composite()" class="member-name-link">composite</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Creates a new composite buffer instance that uses this allocator to create new
backing space when the buffer writes exceed capacity or the ensure writable space
API is used.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#composite(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">composite</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-tab3">
<div class="block">Creates a new composite buffer instance that uses this allocator to create new
backing space when the buffer writes exceed capacity or the ensure writable space
API is used.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#composite(org.apache.qpid.protonj2.buffer.ProtonBuffer%5B%5D)" class="member-name-link">composite</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>[]&nbsp;buffers)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Creates a new composite buffer instance that uses this allocator to create new
backing space when the buffer writes exceed capacity or the ensure writable space
API is used.</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(byte%5B%5D)" class="member-name-link">copy</a><wbr>(byte[]&nbsp;array)</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 new ProtonBuffer that copies the given byte array.</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(byte%5B%5D,int,int)" class="member-name-link">copy</a><wbr>(byte[]&nbsp;array,
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">Create a new ProtonBuffer that copies the given byte array using the provided
offset and length values to confine the view of that array.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#defaultAllocator()" class="member-name-link">defaultAllocator</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1">
<div class="block">Gets an allocator from the proton internal buffer allocator which can be a
default version or may have been configured to ensure all allocations use
a specific allocator instance.</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="#outputBuffer(int)" class="member-name-link">outputBuffer</a><wbr>(int&nbsp;initialCapacity)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Create a new output ProtonBuffer instance with the given initial capacity and the
implicit growth capacity should be that of the underlying buffer implementations limit.</div>
</div>
</div>
</div>
</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="modifiers">default</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">close</span>()</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>
</dl>
</section>
</li>
<li>
<section class="detail" id="defaultAllocator()">
<h3>defaultAllocator</h3>
<div class="member-signature"><span class="modifiers">static</span>&nbsp;<span class="return-type"><a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></span>&nbsp;<span class="element-name">defaultAllocator</span>()</div>
<div class="block">Gets an allocator from the proton internal buffer allocator which can be a
default version or may have been configured to ensure all allocations use
a specific allocator instance.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a <a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferAllocator</code></a> for use in the application.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="outputBuffer(int)">
<h3>outputBuffer</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">outputBuffer</span><wbr><span class="parameters">(int&nbsp;initialCapacity)</span></div>
<div class="block">Create a new output ProtonBuffer instance with the given initial capacity and the
implicit growth capacity should be that of the underlying buffer implementations limit.
The buffer implementation should support growing the buffer on an as needed basis to allow
writes without the user needing to code extra capacity and buffer reallocation checks.
<p>
The returned buffer will be used for frame output from the Proton engine and
can be a pooled buffer which the IO handler will then need to release once
the buffer has been written.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>initialCapacity</code> - The initial capacity to use when creating the new ProtonBuffer.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance with the given initial capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="allocate()">
<h3>allocate</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">allocate</span>()</div>
<div class="block">Create a new ProtonBuffer instance with default initial capacity. The buffer
implementation should support growing the buffer on an as needed basis to allow
writes without the user needing to code extra capacity and buffer reallocation
checks.
<p>
Proton buffers are closable resources and their life-span requires that they
be closed upon reaching their determined end of life.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance with default initial capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="allocate(int)">
<h3>allocate</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">allocate</span><wbr><span class="parameters">(int&nbsp;initialCapacity)</span></div>
<div class="block">Create a new ProtonBuffer instance with the given initial capacity and the
implicit growth limit should be that of the underlying buffer implementations
maximum capacity limit.
<p>
Proton buffers are closable resources and their life-span requires that they
be closed upon reaching their determined end of life.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>initialCapacity</code> - The initial capacity to use when creating the new ProtonBuffer.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance with the given initial capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="allocateHeapBuffer()">
<h3>allocateHeapBuffer</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">allocateHeapBuffer</span>()</div>
<div class="block">Create a new ProtonBuffer instance with default initial capacity. The buffer
implementation should support growing the buffer on an as needed basis to allow
writes without the user needing to code extra capacity and buffer reallocation
checks. The buffer allocated must be a heap buffer for cases where the buffered
resource may not be easily closed and must revert to GC reclaim semantics.
<p>
Proton buffers are closable resources and their life-span requires that they
be closed upon reaching their determined end of life.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance with default initial capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="allocateHeapBuffer(int)">
<h3>allocateHeapBuffer</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">allocateHeapBuffer</span><wbr><span class="parameters">(int&nbsp;initialCapacity)</span></div>
<div class="block">Create a new ProtonBuffer instance with the given initial capacity and the
implicit growth limit should be that of the underlying buffer implementations
maximum capacity limit. The buffer allocated must be a heap buffer for cases
where the buffered resource may not be easily closed and must revert to GC
reclaim semantics.
<p>
Proton buffers are closable resources and their life-span requires that they
be closed upon reaching their determined end of life.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>initialCapacity</code> - The initial capacity to use when creating the new ProtonBuffer.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer instance with the given initial capacity.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="composite()">
<h3>composite</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></span>&nbsp;<span class="element-name">composite</span>()</div>
<div class="block">Creates a new composite buffer instance that uses this allocator to create new
backing space when the buffer writes exceed capacity or the ensure writable space
API is used. The created buffer will be empty and can be expanded with the normal
buffer API or extended with the addition of buffers.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a new empty composite buffer instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="composite(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>composite</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></span>&nbsp;<span class="element-name">composite</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">Creates a new composite buffer instance that uses this allocator to create new
backing space when the buffer writes exceed capacity or the ensure writable space
API is used. The created buffer will be composed of the given sequence of buffers.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - the buffers to compose</dd>
<dt>Returns:</dt>
<dd>a new composite buffer instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="composite(org.apache.qpid.protonj2.buffer.ProtonBuffer[])">
<h3>composite</h3>
<div class="member-signature"><span class="return-type"><a href="ProtonCompositeBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonCompositeBuffer</a></span>&nbsp;<span class="element-name">composite</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>[]&nbsp;buffers)</span></div>
<div class="block">Creates a new composite buffer instance that uses this allocator to create new
backing space when the buffer writes exceed capacity or the ensure writable space
API is used. The created buffer will be composed of the given sequence of buffers.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffers</code> - the array of buffers to compose</dd>
<dt>Returns:</dt>
<dd>a new composite buffer instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy(byte[])">
<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">(byte[]&nbsp;array)</span></div>
<div class="block">Create a new ProtonBuffer that copies the given byte array.
<p>
The capacity for the resulting ProtonBuffer should equal to the length of the
copied array and the returned array read offset is zero The returned buffer
can be expanded using the normal write or expand methods and its write offset
will be set to the buffer capacity.
<p>
Changes to the input buffer after calling this method will not affect the contents
of the returned buffer copy.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - the byte array to copy.</dd>
<dt>Returns:</dt>
<dd>a new ProtonBuffer that is a copy of the given array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy(byte[],int,int)">
<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">(byte[]&nbsp;array,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Create a new ProtonBuffer that copies the given byte array using the provided
offset and length values to confine the view of that array.
<p>
The initial capacity of the buffer should be that of the length of the wrapped array.
The returned buffer can be expanded using the normal write or expand methods. The write
offset of the returned buffer will be set to the capacity.
<p>
Changes to the input buffer after calling this method will not affect the contents
of the returned buffer copy.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - the byte array to copy.</dd>
<dd><code>offset</code> - the offset into the array where the view begins.</dd>
<dd><code>length</code> - the number of bytes in the array to expose</dd>
<dt>Returns:</dt>
<dd>a new <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> that is a copy of the given array.</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; 2023 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>