blob: 85c009e2c0876908bd2fed32c1c23a2f94f6a255 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ProtonBufferUtils (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, class: ProtonBufferUtils">
<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/ProtonBufferUtils.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><a href="#field-summary">Field</a>&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><a href="#field-detail">Field</a>&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</a></div>
<h1 title="Class ProtonBufferUtils" class="title">Class ProtonBufferUtils</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.ProtonBufferUtils</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">ProtonBufferUtils</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></span></div>
<div class="block">Set of Utility methods useful when dealing with byte arrays and other
primitive types.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final int</code></div>
<div class="col-second even-row-color"><code><a href="#MAX_BUFFER_CAPACITY" class="member-name-link">MAX_BUFFER_CAPACITY</a></code></div>
<div class="col-last even-row-color">
<div class="block">The maximum buffer size that allows for JDK byte reservations on buffer
size or addresses.</div>
</div>
</div>
</section>
</li>
<!-- ======== 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">ProtonBufferUtils</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-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-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkArgumentIsNotNegative(int,java.lang.String)" class="member-name-link">checkArgumentIsNotNegative</a><wbr>(int&nbsp;value,
<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>&nbsp;description)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the argument to determine if it less than zero and throws if it is.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkArgumentIsNotNegative(long,java.lang.String)" class="member-name-link">checkArgumentIsNotNegative</a><wbr>(long&nbsp;value,
<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>&nbsp;description)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the argument to determine if it less than zero and throws if it is.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkBufferCanGrowTo(int,int)" class="member-name-link">checkBufferCanGrowTo</a><wbr>(int&nbsp;currentCapacity,
int&nbsp;additional)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks if a buffer can grow buffer the given amount or if that would exceed the
maximum allowed buffer size.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkImplicitGrowthLimit(int,int)" class="member-name-link">checkImplicitGrowthLimit</a><wbr>(int&nbsp;implicitCapacity,
int&nbsp;currentCapacity)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the implicit growth limit value for buffer implementations</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIndexIsNotNegative(int,java.lang.String)" class="member-name-link">checkIndexIsNotNegative</a><wbr>(int&nbsp;value,
<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>&nbsp;description)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the index to determine if it less than zero and throws if it is.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIndexIsNotNegative(long,java.lang.String)" class="member-name-link">checkIndexIsNotNegative</a><wbr>(long&nbsp;value,
<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>&nbsp;description)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the index to determine if it less than zero and throws if it is.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIsClosed(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">checkIsClosed</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-tab1 method-summary-table-tab4">
<div class="block">Checks the given ProtonBuffer to see if it has already been closed.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIsNotNegative(int,java.lang.String)" class="member-name-link">checkIsNotNegative</a><wbr>(int&nbsp;value,
<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>&nbsp;description)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the value to determine if it less than zero and throws if it is.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIsNotNegative(long,java.lang.String)" class="member-name-link">checkIsNotNegative</a><wbr>(long&nbsp;value,
<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>&nbsp;description)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the value to determine if it less than zero and throws if it is.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkIsReadOnly(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">checkIsReadOnly</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-tab1 method-summary-table-tab4">
<div class="block">Checks the given ProtonBuffer to see if it has already been closed.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkLength(int)" class="member-name-link">checkLength</a><wbr>(int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the length value is not negative and throws an exception if it is.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkOffset(int)" class="member-name-link">checkOffset</a><wbr>(int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Checks the offset value is not negative and throws an exception if it is.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#compare(org.apache.qpid.protonj2.buffer.ProtonBuffer,org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">compare</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;lhs,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;rhs)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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-tab1 method-summary-table-tab4"><code><a href="#copyToCharSequence(org.apache.qpid.protonj2.buffer.ProtonBuffer,int,int,java.nio.charset.Charset)" class="member-name-link">copyToCharSequence</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;source,
int&nbsp;offset,
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-tab1 method-summary-table-tab4">
<div class="block">Copies the given length number of bytes from the provided buffer and returns 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>
that is comprised of the characters of that sequence using the provided <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 make
the transformation.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#equals(org.apache.qpid.protonj2.buffer.ProtonBuffer,int,org.apache.qpid.protonj2.buffer.ProtonBuffer,int,int)" class="member-name-link">equals</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;left,
int&nbsp;leftStartIndex,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;right,
int&nbsp;rightStartIndex,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances for equality.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#equals(org.apache.qpid.protonj2.buffer.ProtonBuffer,org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">equals</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;left,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;right)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances for equality.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#equals(org.apache.qpid.protonj2.buffer.ProtonBuffer,org.apache.qpid.protonj2.buffer.ProtonBuffer,int)" class="member-name-link">equals</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;left,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;right,
int&nbsp;length)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances for equality.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ProtonBufferClosedException.html" title="class in org.apache.qpid.protonj2.buffer">ProtonBufferClosedException</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#genericBufferIsClosed(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">genericBufferIsClosed</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-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ProtonBufferReadOnlyException.html" title="class in org.apache.qpid.protonj2.buffer">ProtonBufferReadOnlyException</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#genericBufferIsReadOnly(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">genericBufferIsReadOnly</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-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#genericOutOfBounds(org.apache.qpid.protonj2.buffer.ProtonBuffer,int)" class="member-name-link">genericOutOfBounds</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer,
int&nbsp;index)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link">Cleaner</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getCleaner()" class="member-name-link">getCleaner</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Create and / or return a Cleaner instance on demand and then serve out only that
instance from then on.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#hashCode(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">hashCode</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-tab1 method-summary-table-tab4">
<div class="block">Compute a hash code from the given <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readByte(byte%5B%5D,int)" class="member-name-link">readByte</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a single byte from the given array from the provided offset.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static char</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readChar(byte%5B%5D,int)" class="member-name-link">readChar</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a two byte UTF-16 character from the given array from the provided offset.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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 even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readCharSequence(org.apache.qpid.protonj2.buffer.ProtonBuffer,int,java.nio.charset.Charset)" class="member-name-link">readCharSequence</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;source,
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 even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<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> from the given <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> advancing the read offset
by the length value provided.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readDouble(byte%5B%5D,int)" class="member-name-link">readDouble</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads an eight byte double precision value from the given array from the provided offset.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static float</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readFloat(byte%5B%5D,int)" class="member-name-link">readFloat</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a four byte floating point value from the given array from the provided offset.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readInt(byte%5B%5D,int)" class="member-name-link">readInt</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a four byte integer from the given array from the provided offset.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readLong(byte%5B%5D,int)" class="member-name-link">readLong</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads an eight byte integer from the given array from the provided offset.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static short</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readShort(byte%5B%5D,int)" class="member-name-link">readShort</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a two byte short from the given array from the provided offset.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readUnsignedByte(byte%5B%5D,int)" class="member-name-link">readUnsignedByte</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a single byte from the given array from the provided offset and returns it as an
integer that represents the unsigned byte value.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static long</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readUnsignedInt(byte%5B%5D,int)" class="member-name-link">readUnsignedInt</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a four byte integer from the given array from the provided offset.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#readUnsignedShort(byte%5B%5D,int)" class="member-name-link">readUnsignedShort</a><wbr>(byte[]&nbsp;array,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Reads a two byte short from the given array from the provided offset and return it
in an integer value that represents the unsigned short value.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.Cleanable.html" title="class or interface in java.lang.ref" class="external-link">Cleaner.Cleanable</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#registerCleanup(java.lang.Object,org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">registerCleanup</a><wbr>(<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>&nbsp;observed,
<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-tab1 method-summary-table-tab4">
<div class="block">Register a cleanup watch on the given object which is related to the <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a>
provided and ensure that if the object does not close the buffer by the time it becomes
unreachable that the buffer is closed.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#setCleaner(java.lang.ref.Cleaner)" class="member-name-link">setCleaner</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link">Cleaner</a>&nbsp;cleaner)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Allows an external application <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link"><code>Cleaner</code></a> instance to be assigned to the
buffer utilities Cleaner instance which will then be used if a cleaner for a
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> is registered.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteArray(byte)" class="member-name-link">toByteArray</a><wbr>(byte&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Given a byte value returns an array containing the given byte as the only entry.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteArray(int)" class="member-name-link">toByteArray</a><wbr>(int&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Given an integer value returns an array containing the given byte as the only entry.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteArray(long)" class="member-name-link">toByteArray</a><wbr>(long&nbsp;value)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Given a long value returns an array containing the given byte as the only entry.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteArray(short)" class="member-name-link">toByteArray</a><wbr>(short&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Given a short value returns an array containing the given byte as the only entry.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteArray(java.nio.ByteBuffer)" class="member-name-link">toByteArray</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;buffer)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Given a <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> returns an array containing a copy of the readable bytes
from the provided buffer.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteArray(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">toByteArray</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-tab1 method-summary-table-tab4">
<div class="block">Given a <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> returns an array containing a deep copy of the readable
bytes from the provided buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toByteBuffer(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">toByteBuffer</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-tab1 method-summary-table-tab4">
<div class="block">Given a <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> returns an <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> containing a copy of the
readable bytes from the provided buffer.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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 even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toString(org.apache.qpid.protonj2.buffer.ProtonBuffer,java.nio.charset.Charset)" class="member-name-link">toString</a><wbr>(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer,
<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 even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Create a new String that is a copy of the boffer's readable bytes and
is defined by 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> provided.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#unclosable(org.apache.qpid.protonj2.buffer.ProtonBufferAllocator)" class="member-name-link">unclosable</a><wbr>(<a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a>&nbsp;allocator)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a wrapper around the given allocator that prevents the close call
from having any effect.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeByte(byte,byte%5B%5D,int)" class="member-name-link">writeByte</a><wbr>(byte&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeChar(char,byte%5B%5D,int)" class="member-name-link">writeChar</a><wbr>(char&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeDouble(double,byte%5B%5D,int)" class="member-name-link">writeDouble</a><wbr>(double&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeFloat(float,byte%5B%5D,int)" class="member-name-link">writeFloat</a><wbr>(float&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeInt(int,byte%5B%5D,int)" class="member-name-link">writeInt</a><wbr>(int&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeLong(long,byte%5B%5D,int)" class="member-name-link">writeLong</a><wbr>(long&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeShort(short,byte%5B%5D,int)" class="member-name-link">writeShort</a><wbr>(short&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeUnsignedByte(int,byte%5B%5D,int)" class="member-name-link">writeUnsignedByte</a><wbr>(int&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeUnsignedInt(long,byte%5B%5D,int)" class="member-name-link">writeUnsignedInt</a><wbr>(long&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#writeUnsignedShort(int,byte%5B%5D,int)" class="member-name-link">writeUnsignedShort</a><wbr>(int&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</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>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="MAX_BUFFER_CAPACITY">
<h3>MAX_BUFFER_CAPACITY</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">MAX_BUFFER_CAPACITY</span></div>
<div class="block">The maximum buffer size that allows for JDK byte reservations on buffer
size or addresses.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../../../constant-values.html#org.apache.qpid.protonj2.buffer.ProtonBufferUtils.MAX_BUFFER_CAPACITY">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= 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>ProtonBufferUtils</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">ProtonBufferUtils</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="getCleaner()">
<h3>getCleaner</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link">Cleaner</a></span>&nbsp;<span class="element-name">getCleaner</span>()</div>
<div class="block">Create and / or return a Cleaner instance on demand and then serve out only that
instance from then on.
<p>
Care should be taken when using Cleaners as the instance will be tired to a thread that
will run to perform the cleanups, an application is advised to assign a single global
value for the whole application,</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link"><code>Cleaner</code></a> instance which is created on demand or was already assigned.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setCleaner(java.lang.ref.Cleaner)">
<h3>setCleaner</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setCleaner</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link">Cleaner</a>&nbsp;cleaner)</span></div>
<div class="block">Allows an external application <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link"><code>Cleaner</code></a> instance to be assigned to the
buffer utilities Cleaner instance which will then be used if a cleaner for a
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> is registered.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>cleaner</code> - The cleaner to assign as the global <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link"><code>Cleaner</code></a> for buffer instances.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="registerCleanup(java.lang.Object,org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>registerCleanup</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.Cleanable.html" title="class or interface in java.lang.ref" class="external-link">Cleaner.Cleanable</a></span>&nbsp;<span class="element-name">registerCleanup</span><wbr><span class="parameters">(<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>&nbsp;observed,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer)</span></div>
<div class="block">Register a cleanup watch on the given object which is related to the <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a>
provided and ensure that if the object does not close the buffer by the time it becomes
unreachable that the buffer is closed.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>observed</code> - The resource holder that if unreachable should release the given buffer</dd>
<dd><code>buffer</code> - The buffer to be closed when the observed object is unreachable.</dd>
<dt>Returns:</dt>
<dd>a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/Cleaner.html" title="class or interface in java.lang.ref" class="external-link"><code>Cleaner</code></a> instance the caller can invoke explicitly.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString(org.apache.qpid.protonj2.buffer.ProtonBuffer,java.nio.charset.Charset)">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public static</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="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer,
<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">Create a new String that is a copy of the boffer's readable bytes and
is defined by 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> provided.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer to convert to a string</dd>
<dd><code>charset</code> - The charset to use when creating the new string.</dd>
<dt>Returns:</dt>
<dd>a <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"><code>String</code></a> that is a view of the given buffer's readable bytes.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</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">Given a <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> returns an array containing a deep copy of the readable
bytes from the provided buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer whose readable bytes are to be copied.</dd>
<dt>Returns:</dt>
<dd>a new array containing a copy of the readable bytes from the buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(java.nio.ByteBuffer)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</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;buffer)</span></div>
<div class="block">Given a <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> returns an array containing a copy of the readable bytes
from the provided buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer whose readable bytes are to be copied.</dd>
<dt>Returns:</dt>
<dd>a new array containing a copy of the readable bytes from the buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteBuffer(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>toByteBuffer</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">toByteBuffer</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">Given a <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> returns an <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> containing a copy of the
readable bytes from the provided buffer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer whose readable bytes are to be copied.</dd>
<dt>Returns:</dt>
<dd>a new <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> containing a copy of the readable bytes from the buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(byte)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</span><wbr><span class="parameters">(byte&nbsp;value)</span></div>
<div class="block">Given a byte value returns an array containing the given byte as the only entry.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to wrap in an array instance.</dd>
<dt>Returns:</dt>
<dd>a new array containing the primitive value as the only array element.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(short)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</span><wbr><span class="parameters">(short&nbsp;value)</span></div>
<div class="block">Given a short value returns an array containing the given byte as the only entry.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to wrap in an array instance.</dd>
<dt>Returns:</dt>
<dd>a new array containing the primitive value as the only array element.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(int)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</span><wbr><span class="parameters">(int&nbsp;value)</span></div>
<div class="block">Given an integer value returns an array containing the given byte as the only entry.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to wrap in an array instance.</dd>
<dt>Returns:</dt>
<dd>a new array containing the primitive value as the only array element.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toByteArray(long)">
<h3>toByteArray</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">toByteArray</span><wbr><span class="parameters">(long&nbsp;value)</span></div>
<div class="block">Given a long value returns an array containing the given byte as the only entry.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to wrap in an array instance.</dd>
<dt>Returns:</dt>
<dd>a new array containing the primitive value as the only array element.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeChar(char,byte[],int)">
<h3>writeChar</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeChar</span><wbr><span class="parameters">(char&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeByte(byte,byte[],int)">
<h3>writeByte</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeByte</span><wbr><span class="parameters">(byte&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeUnsignedByte(int,byte[],int)">
<h3>writeUnsignedByte</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeUnsignedByte</span><wbr><span class="parameters">(int&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeShort(short,byte[],int)">
<h3>writeShort</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeShort</span><wbr><span class="parameters">(short&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeUnsignedShort(int,byte[],int)">
<h3>writeUnsignedShort</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeUnsignedShort</span><wbr><span class="parameters">(int&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeInt(int,byte[],int)">
<h3>writeInt</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeInt</span><wbr><span class="parameters">(int&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeUnsignedInt(long,byte[],int)">
<h3>writeUnsignedInt</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeUnsignedInt</span><wbr><span class="parameters">(long&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeLong(long,byte[],int)">
<h3>writeLong</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeLong</span><wbr><span class="parameters">(long&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeFloat(float,byte[],int)">
<h3>writeFloat</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeFloat</span><wbr><span class="parameters">(float&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeDouble(double,byte[],int)">
<h3>writeDouble</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name">writeDouble</span><wbr><span class="parameters">(double&nbsp;value,
byte[]&nbsp;destination,
int&nbsp;offset)</span></div>
<div class="block">Writes the value given into the provided array at the specified offset returning to
destination once done. The provided array must have enough space starting from the
given offset for the value to be encoded or an exception will be thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The value to be encoded into the given array</dd>
<dd><code>destination</code> - The given array where the provided value should be written.</dd>
<dd><code>offset</code> - The offset into the array to start writing.</dd>
<dt>Returns:</dt>
<dd>the provided destination array.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readByte(byte[],int)">
<h3>readByte</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">byte</span>&nbsp;<span class="element-name">readByte</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a single byte from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readUnsignedByte(byte[],int)">
<h3>readUnsignedByte</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">readUnsignedByte</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a single byte from the given array from the provided offset and returns it as an
integer that represents the unsigned byte value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readShort(byte[],int)">
<h3>readShort</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">short</span>&nbsp;<span class="element-name">readShort</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a two byte short from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readUnsignedShort(byte[],int)">
<h3>readUnsignedShort</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">readUnsignedShort</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a two byte short from the given array from the provided offset and return it
in an integer value that represents the unsigned short value.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readChar(byte[],int)">
<h3>readChar</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">char</span>&nbsp;<span class="element-name">readChar</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a two byte UTF-16 character from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readInt(byte[],int)">
<h3>readInt</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">readInt</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a four byte integer from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readUnsignedInt(byte[],int)">
<h3>readUnsignedInt</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">readUnsignedInt</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a four byte integer from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readLong(byte[],int)">
<h3>readLong</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">readLong</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads an eight byte integer from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readFloat(byte[],int)">
<h3>readFloat</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">float</span>&nbsp;<span class="element-name">readFloat</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads a four byte floating point value from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readDouble(byte[],int)">
<h3>readDouble</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">readDouble</span><wbr><span class="parameters">(byte[]&nbsp;array,
int&nbsp;offset)</span></div>
<div class="block">Reads an eight byte double precision value from the given array from the provided offset.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>array</code> - The array to be read from</dd>
<dd><code>offset</code> - The offset into the array to start reading from.</dd>
<dt>Returns:</dt>
<dd>the resulting value read from the array at the provided array offset.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkLength(int)">
<h3>checkLength</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkLength</span><wbr><span class="parameters">(int&nbsp;length)</span></div>
<div class="block">Checks the length value is not negative and throws an exception if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - The length value to be validated</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkIsNotNegative(int,java.lang.String)">
<h3>checkIsNotNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIsNotNegative</span><wbr><span class="parameters">(int&nbsp;value,
<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>&nbsp;description)</span></div>
<div class="block">Checks the value to determine if it less than zero and throws if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The length value to be validated</dd>
<dd><code>description</code> - A description value appended to the exception string.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkIsNotNegative(long,java.lang.String)">
<h3>checkIsNotNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIsNotNegative</span><wbr><span class="parameters">(long&nbsp;value,
<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>&nbsp;description)</span></div>
<div class="block">Checks the value to determine if it less than zero and throws if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The length value to be validated</dd>
<dd><code>description</code> - A description value appended to the exception string.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkIndexIsNotNegative(int,java.lang.String)">
<h3>checkIndexIsNotNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIndexIsNotNegative</span><wbr><span class="parameters">(int&nbsp;value,
<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>&nbsp;description)</span></div>
<div class="block">Checks the index to determine if it less than zero and throws if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The index value to be validated</dd>
<dd><code>description</code> - A description value appended to the exception string.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkIndexIsNotNegative(long,java.lang.String)">
<h3>checkIndexIsNotNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIndexIsNotNegative</span><wbr><span class="parameters">(long&nbsp;value,
<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>&nbsp;description)</span></div>
<div class="block">Checks the index to determine if it less than zero and throws if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The index value to be validated</dd>
<dd><code>description</code> - A description value appended to the exception string.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkArgumentIsNotNegative(int,java.lang.String)">
<h3>checkArgumentIsNotNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkArgumentIsNotNegative</span><wbr><span class="parameters">(int&nbsp;value,
<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>&nbsp;description)</span></div>
<div class="block">Checks the argument to determine if it less than zero and throws if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The argument value to be validated</dd>
<dd><code>description</code> - A description value appended to the exception string.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkArgumentIsNotNegative(long,java.lang.String)">
<h3>checkArgumentIsNotNegative</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkArgumentIsNotNegative</span><wbr><span class="parameters">(long&nbsp;value,
<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>&nbsp;description)</span></div>
<div class="block">Checks the argument to determine if it less than zero and throws if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>value</code> - The argument value to be validated</dd>
<dd><code>description</code> - A description value appended to the exception string.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkOffset(int)">
<h3>checkOffset</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkOffset</span><wbr><span class="parameters">(int&nbsp;offset)</span></div>
<div class="block">Checks the offset value is not negative and throws an exception if it is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - The offset value to be validated</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkIsClosed(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>checkIsClosed</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIsClosed</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">Checks the given ProtonBuffer to see if it has already been closed.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer to check if closed</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkIsReadOnly(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>checkIsReadOnly</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkIsReadOnly</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">Checks the given ProtonBuffer to see if it has already been closed.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer to check if closed</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkBufferCanGrowTo(int,int)">
<h3>checkBufferCanGrowTo</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkBufferCanGrowTo</span><wbr><span class="parameters">(int&nbsp;currentCapacity,
int&nbsp;additional)</span></div>
<div class="block">Checks if a buffer can grow buffer the given amount or if that would exceed the
maximum allowed buffer size.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>currentCapacity</code> - The buffer's current capacity.</dd>
<dd><code>additional</code> - The amount of new space that will be added to the buffer.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="checkImplicitGrowthLimit(int,int)">
<h3>checkImplicitGrowthLimit</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">checkImplicitGrowthLimit</span><wbr><span class="parameters">(int&nbsp;implicitCapacity,
int&nbsp;currentCapacity)</span></div>
<div class="block">Checks the implicit growth limit value for buffer implementations</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>implicitCapacity</code> - The intended implicit growth limit to assign</dd>
<dd><code>currentCapacity</code> - The current buffer capacity</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="genericBufferIsClosed(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>genericBufferIsClosed</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="ProtonBufferClosedException.html" title="class in org.apache.qpid.protonj2.buffer">ProtonBufferClosedException</a></span>&nbsp;<span class="element-name">genericBufferIsClosed</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer)</span></div>
</section>
</li>
<li>
<section class="detail" id="genericBufferIsReadOnly(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>genericBufferIsReadOnly</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="ProtonBufferReadOnlyException.html" title="class in org.apache.qpid.protonj2.buffer">ProtonBufferReadOnlyException</a></span>&nbsp;<span class="element-name">genericBufferIsReadOnly</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer)</span></div>
</section>
</li>
<li>
<section class="detail" id="genericOutOfBounds(org.apache.qpid.protonj2.buffer.ProtonBuffer,int)">
<h3>genericOutOfBounds</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">genericOutOfBounds</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;buffer,
int&nbsp;index)</span></div>
</section>
</li>
<li>
<section class="detail" id="equals(org.apache.qpid.protonj2.buffer.ProtonBuffer,org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;left,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;right)</span></div>
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances for equality.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>left</code> - The left hand side buffer to compare.</dd>
<dd><code>right</code> - The right hand side buffer to compare.</dd>
<dt>Returns:</dt>
<dd>true if both buffers are equal.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(org.apache.qpid.protonj2.buffer.ProtonBuffer,org.apache.qpid.protonj2.buffer.ProtonBuffer,int)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;left,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;right,
int&nbsp;length)</span></div>
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances for equality.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>left</code> - The left hand side buffer to compare.</dd>
<dd><code>right</code> - The right hand side buffer to compare.</dd>
<dd><code>length</code> - The number of bytes in the two buffers to compare.</dd>
<dt>Returns:</dt>
<dd>true if both buffers are equal.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(org.apache.qpid.protonj2.buffer.ProtonBuffer,int,org.apache.qpid.protonj2.buffer.ProtonBuffer,int,int)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;left,
int&nbsp;leftStartIndex,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;right,
int&nbsp;rightStartIndex,
int&nbsp;length)</span></div>
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances for equality.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>left</code> - The left hand side buffer to compare.</dd>
<dd><code>leftStartIndex</code> - The index in the readable bytes of the left buffer to start the comparison</dd>
<dd><code>right</code> - The right hand side buffer to compare.</dd>
<dd><code>rightStartIndex</code> - The index in the readable bytes of the right buffer to start the comparison</dd>
<dd><code>length</code> - The number of bytes in the two buffers to compare.</dd>
<dt>Returns:</dt>
<dd>true if both buffers are equal.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="hashCode(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>hashCode</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">hashCode</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">Compute a hash code from the given <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>buffer</code> - The buffer to compute the hash code for.</dd>
<dt>Returns:</dt>
<dd>the computed hash code for the given buffer</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="compare(org.apache.qpid.protonj2.buffer.ProtonBuffer,org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>compare</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">compare</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;lhs,
<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;rhs)</span></div>
<div class="block">Compares two <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> instances.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>lhs</code> - The left hand side buffer to compare</dd>
<dd><code>rhs</code> - The right hand side buffer to compare.</dd>
<dt>Returns:</dt>
<dd>the value 0 if <code>x == y</code>; a value less than 0 if <code>x &lt; y</code>; and a value greater than 0 if <code>x &gt; y</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="readCharSequence(org.apache.qpid.protonj2.buffer.ProtonBuffer,int,java.nio.charset.Charset)">
<h3>readCharSequence</h3>
<div class="member-signature"><span class="modifiers">public static</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">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;source,
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> from the given <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> advancing the read offset
by the length value provided.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> that will provide the bytes to create 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>.</dd>
<dd><code>length</code> - The number of bytes to copy starting at the given offset.</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 to create the returned <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 <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> that is made up of the copied bytes using the provided <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="copyToCharSequence(org.apache.qpid.protonj2.buffer.ProtonBuffer,int,int,java.nio.charset.Charset)">
<h3>copyToCharSequence</h3>
<div class="member-signature"><span class="modifiers">public static</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">copyToCharSequence</span><wbr><span class="parameters">(<a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;source,
int&nbsp;offset,
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">Copies the given length number of bytes from the provided buffer and returns 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>
that is comprised of the characters of that sequence using the provided <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 make
the transformation.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - The <a href="ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBuffer</code></a> that will provide the bytes to create 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>.</dd>
<dd><code>offset</code> - The offset into the given buffer where the copy of bytes should be started from.</dd>
<dd><code>length</code> - The number of bytes to copy starting at the given offset.</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 to create the returned <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 <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> that is made up of the copied bytes using the provided <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="unclosable(org.apache.qpid.protonj2.buffer.ProtonBufferAllocator)">
<h3>unclosable</h3>
<div class="member-signature"><span class="modifiers">public 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">unclosable</span><wbr><span class="parameters">(<a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBufferAllocator</a>&nbsp;allocator)</span></div>
<div class="block">Creates a wrapper around the given allocator that prevents the close call
from having any effect.
<p>
Care should be taken to ensure that the allocator being wrapper is safe to leave
unclosed or that the code closes it purposefully in some other context as certain
wrapped allocators might require a close to free native resources.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>allocator</code> - the <a href="ProtonBufferAllocator.html" title="interface in org.apache.qpid.protonj2.buffer"><code>ProtonBufferAllocator</code></a> to wrap.</dd>
<dt>Returns:</dt>
<dd>a buffer allocator that cannot be closed.</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>