blob: 0f8b918301bc9fa4e2eba6856b3d57541f7aff13 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ProtonByteArrayBufferAllocator (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.impl, class: ProtonByteArrayBufferAllocator">
<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/ProtonByteArrayBufferAllocator.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><a href="#constructor-summary">Constr</a>&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><a href="#constructor-detail">Constr</a>&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.impl</a></div>
<h1 title="Class ProtonByteArrayBufferAllocator" class="title">Class ProtonByteArrayBufferAllocator</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><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">java.lang.Object</a>
<div class="inheritance">org.apache.qpid.protonj2.buffer.impl.ProtonByteArrayBufferAllocator</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</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="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">ProtonByteArrayBufferAllocator</span>
<span class="extends-implements">extends <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>
implements <a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></span></div>
<div class="block">A Proton built in byte array based buffer allocator</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">ProtonByteArrayBufferAllocator</a>()</code></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</section>
</li>
<!-- ========== 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-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete 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-tab4"><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-tab4"><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-tab4">
<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-tab4"><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-tab4"><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-tab4">
<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-tab4"><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-tab4"><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-tab4">
<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-tab4"><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-tab4"><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-tab4">
<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-tab1 method-summary-table-tab4"><code>static final <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 method-summary-table-tab4"><code><a href="#allocator()" class="member-name-link">allocator</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#close()" class="member-name-link">close</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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-tab4"><code><a href="#composite()" class="member-name-link">composite</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<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-tab4"><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-tab4"><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 odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<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-tab4"><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-tab4"><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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<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-tab4"><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-tab4"><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-tab4">
<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-tab2 method-summary-table-tab4"><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-tab4"><code><a href="#outputBuffer(int)" class="member-name-link">outputBuffer</a><wbr>(int&nbsp;initialCapacity)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<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 class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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-tab4"><code><a href="#wrap(byte%5B%5D,int,int)" class="member-name-link">wrap</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-tab4">
<div class="block">Shallow copy of the given array segment used when the caller knows that
they will not share the bytes wrapped with any other application code.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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-tab1 method-summary-table-tab4"><code><a href="#wrapped(byte%5B%5D)" class="member-name-link">wrapped</a><wbr>(byte[]&nbsp;array)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Shallow copy of the given array segment used when the caller knows that
they will not share the bytes wrapped with any other application code.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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-tab1 method-summary-table-tab4"><code><a href="#wrapped(byte%5B%5D,int,int)" class="member-name-link">wrapped</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-tab1 method-summary-table-tab4">
<div class="block">Shallow copy of the given array segment used when the caller knows that
they will not share the bytes wrapped with any other application code.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<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></h3>
<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.qpid.protonj2.buffer.ProtonBufferAllocator">Methods inherited from interface&nbsp;org.apache.qpid.protonj2.buffer.<a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></h3>
<code><a href="../ProtonBufferAllocator.html#copy(byte%5B%5D)">copy</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>ProtonByteArrayBufferAllocator</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">ProtonByteArrayBufferAllocator</span>()</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ 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">public</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>
<dt>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#close()">close</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="allocator()">
<h3>allocator</h3>
<div class="member-signature"><span class="modifiers">public static final</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">allocator</span>()</div>
</section>
</li>
<li>
<section class="detail" id="outputBuffer(int)">
<h3>outputBuffer</h3>
<div class="member-signature"><span class="modifiers">public</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">outputBuffer</span><wbr><span class="parameters">(int&nbsp;initialCapacity)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#outputBuffer(int)">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#outputBuffer(int)">outputBuffer</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="modifiers">public</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">allocate</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#allocate()">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#allocate()">allocate</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="modifiers">public</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">allocate</span><wbr><span class="parameters">(int&nbsp;initialCapacity)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#allocate(int)">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#allocate(int)">allocate</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="modifiers">public</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">allocateHeapBuffer</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#allocateHeapBuffer()">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#allocateHeapBuffer()">allocateHeapBuffer</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="modifiers">public</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">allocateHeapBuffer</span><wbr><span class="parameters">(int&nbsp;initialCapacity)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#allocateHeapBuffer(int)">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#allocateHeapBuffer(int)">allocateHeapBuffer</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="copy(byte[],int,int)">
<h3>copy</h3>
<div class="member-signature"><span class="modifiers">public</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,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#copy(byte%5B%5D,int,int)">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#copy(byte%5B%5D,int,int)">copy</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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>
<li>
<section class="detail" id="wrap(byte[],int,int)">
<h3>wrap</h3>
<div class="member-signature"><span class="modifiers">public</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">wrap</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Shallow copy of the given array segment used when the caller knows that
they will not share the bytes wrapped with any other application code.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array that should be wrapped</dd>
<dd><code>offset</code> - The offset into the array where the wrapper starts</dd>
<dd><code>length</code> - The number of bytes that will be represented in the span.</dd>
<dt>Returns:</dt>
<dd>A <a href="../ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> that wraps the given array bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="composite()">
<h3>composite</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<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"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#composite()">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#composite()">composite</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="modifiers">public</span>&nbsp;<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"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#composite(org.apache.qpid.protonj2.buffer.ProtonBuffer)">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#composite(org.apache.qpid.protonj2.buffer.ProtonBuffer)">composite</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="modifiers">public</span>&nbsp;<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"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="../ProtonBufferAllocator.html#composite(org.apache.qpid.protonj2.buffer.ProtonBuffer%5B%5D)">ProtonBufferAllocator</a></code></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>Specified by:</dt>
<dd><code><a href="../ProtonBufferAllocator.html#composite(org.apache.qpid.protonj2.buffer.ProtonBuffer%5B%5D)">composite</a></code>&nbsp;in interface&nbsp;<code><a href="../ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></dd>
<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="wrapped(byte[])">
<h3>wrapped</h3>
<div class="member-signature"><span class="modifiers">public static</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">wrapped</span><wbr><span class="parameters">(byte[]&nbsp;array)</span></div>
<div class="block">Shallow copy of the given array segment used when the caller knows that
they will not share the bytes wrapped with any other application code.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array that should be wrapped</dd>
<dt>Returns:</dt>
<dd>A <a href="../ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> that wraps the given array bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="wrapped(byte[],int,int)">
<h3>wrapped</h3>
<div class="member-signature"><span class="modifiers">public static</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">wrapped</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset,
int&nbsp;length)</span></div>
<div class="block">Shallow copy of the given array segment used when the caller knows that
they will not share the bytes wrapped with any other application code.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array that should be wrapped</dd>
<dd><code>offset</code> - The offset into the array where the wrapper starts</dd>
<dd><code>length</code> - The number of bytes that will be represented in the span.</dd>
<dt>Returns:</dt>
<dd>A <a href="../ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> that wraps the given array bytes.</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>