| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.11) on Mon Jun 14 16:44:01 EDT 2021 --> |
| <title>BufferUtil (Eclipse Jetty API Doc - v11.0.5)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2021-06-14"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="BufferUtil (Eclipse Jetty API Doc - v11.0.5)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9,"i22":9,"i23":9,"i24":9,"i25":9,"i26":9,"i27":9,"i28":9,"i29":9,"i30":9,"i31":9,"i32":9,"i33":9,"i34":9,"i35":9,"i36":9,"i37":9,"i38":9,"i39":9,"i40":9,"i41":9,"i42":9,"i43":9,"i44":9,"i45":9,"i46":9,"i47":9,"i48":9,"i49":9,"i50":9,"i51":9,"i52":9,"i53":9,"i54":9,"i55":9,"i56":9,"i57":9,"i58":9,"i59":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/BufferUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.eclipse.jetty.util</a></div> |
| <h2 title="Class BufferUtil" class="title">Class BufferUtil</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.eclipse.jetty.util.BufferUtil</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public class <span class="typeNameLabel">BufferUtil</span> |
| extends java.lang.Object</pre> |
| <div class="block">Buffer utility methods. |
| <p>The standard JVM <code>ByteBuffer</code> can exist in two modes: In fill mode the valid |
| data is between 0 and pos; In flush mode the valid data is between the pos and the limit. |
| The various ByteBuffer methods assume a mode and some of them will switch or enforce a mode: |
| Allocate and clear set fill mode; flip and compact switch modes; read and write assume fill |
| and flush modes. This duality can result in confusing code such as: |
| </p> |
| <pre> |
| buffer.clear(); |
| channel.write(buffer); |
| </pre> |
| <p> |
| Which looks as if it should write no data, but in fact writes the buffer worth of garbage. |
| </p> |
| <p> |
| The BufferUtil class provides a set of utilities that operate on the convention that ByteBuffers |
| will always be left, passed in an API or returned from a method in the flush mode - ie with |
| valid data between the pos and limit. This convention is adopted so as to avoid confusion as to |
| what state a buffer is in and to avoid excessive copying of data that can result with the usage |
| of compress.</p> |
| <p> |
| Thus this class provides alternate implementations of <a href="#allocate(int)"><code>allocate(int)</code></a>, |
| <a href="#allocateDirect(int)"><code>allocateDirect(int)</code></a> and <a href="#clear(java.nio.ByteBuffer)"><code>clear(ByteBuffer)</code></a> that leave the buffer |
| in flush mode. Thus the following tests will pass: |
| </p> |
| <pre> |
| ByteBuffer buffer = BufferUtil.allocate(1024); |
| assert(buffer.remaining()==0); |
| BufferUtil.clear(buffer); |
| assert(buffer.remaining()==0); |
| </pre> |
| <p>If the BufferUtil methods <a href="#fill(java.nio.ByteBuffer,byte%5B%5D,int,int)"><code>fill(ByteBuffer, byte[], int, int)</code></a>, |
| <a href="#append(java.nio.ByteBuffer,byte%5B%5D,int,int)"><code>append(ByteBuffer, byte[], int, int)</code></a> or <a href="#put(java.nio.ByteBuffer,java.nio.ByteBuffer)"><code>put(ByteBuffer, ByteBuffer)</code></a> are used, |
| then the caller does not need to explicitly switch the buffer to fill mode. |
| If the caller wishes to use other ByteBuffer bases libraries to fill a buffer, |
| then they can use explicit calls of #flipToFill(ByteBuffer) and #flipToFlush(ByteBuffer, int) |
| to change modes. Note because this convention attempts to avoid the copies of compact, the position |
| is not set to zero on each fill cycle and so its value must be remembered: |
| </p> |
| <pre> |
| int pos = BufferUtil.flipToFill(buffer); |
| try |
| { |
| buffer.put(data); |
| } |
| finally |
| { |
| flipToFlush(buffer, pos); |
| } |
| </pre> |
| <p> |
| The flipToFill method will effectively clear the buffer if it is empty and will compact the buffer if there is no space. |
| </p></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#EMPTY_BUFFER">EMPTY_BUFFER</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">BufferUtil</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#allocate(int)">allocate</a></span>​(int capacity)</code></th> |
| <td class="colLast"> |
| <div class="block">Allocate ByteBuffer in flush mode.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#allocate(int,boolean)">allocate</a></span>​(int capacity, |
| boolean direct)</code></th> |
| <td class="colLast"> |
| <div class="block">Allocates a ByteBuffer in flush mode.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#allocateDirect(int)">allocateDirect</a></span>​(int capacity)</code></th> |
| <td class="colLast"> |
| <div class="block">Allocate ByteBuffer in flush mode.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.nio.ByteBuffer,byte)">append</a></span>​(java.nio.ByteBuffer to, |
| byte b)</code></th> |
| <td class="colLast"> |
| <div class="block">Appends a byte to a buffer</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.nio.ByteBuffer,byte%5B%5D)">append</a></span>​(java.nio.ByteBuffer to, |
| byte[] b)</code></th> |
| <td class="colLast"> |
| <div class="block">Append bytes to a buffer.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.nio.ByteBuffer,byte%5B%5D,int,int)">append</a></span>​(java.nio.ByteBuffer to, |
| byte[] b, |
| int off, |
| int len)</code></th> |
| <td class="colLast"> |
| <div class="block">Append bytes to a buffer.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.nio.ByteBuffer,java.lang.String)">append</a></span>​(java.nio.ByteBuffer to, |
| java.lang.String s)</code></th> |
| <td class="colLast"> |
| <div class="block">Append a string to a buffer.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#append(java.nio.ByteBuffer,java.nio.ByteBuffer)">append</a></span>​(java.nio.ByteBuffer to, |
| java.nio.ByteBuffer b)</code></th> |
| <td class="colLast"> |
| <div class="block">Appends a buffer to a buffer</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clear(java.nio.ByteBuffer)">clear</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Clear the buffer to be empty in flush mode.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clearToFill(java.nio.ByteBuffer)">clearToFill</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Clear the buffer to be empty in fill mode.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compact(java.nio.ByteBuffer)">compact</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Compact the buffer</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copy(java.nio.ByteBuffer)">copy</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Deep copy of a buffer</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ensureCapacity(java.nio.ByteBuffer,int)">ensureCapacity</a></span>​(java.nio.ByteBuffer buffer, |
| int capacity)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fill(java.nio.ByteBuffer,byte%5B%5D,int,int)">fill</a></span>​(java.nio.ByteBuffer to, |
| byte[] b, |
| int off, |
| int len)</code></th> |
| <td class="colLast"> |
| <div class="block">Like append, but does not throw <code>BufferOverflowException</code></div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#flipToFill(java.nio.ByteBuffer)">flipToFill</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Flip the buffer to fill mode.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#flipToFlush(java.nio.ByteBuffer,int)">flipToFlush</a></span>​(java.nio.ByteBuffer buffer, |
| int position)</code></th> |
| <td class="colLast"> |
| <div class="block">Flip the buffer to Flush mode.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasContent(java.nio.ByteBuffer)">hasContent</a></span>​(java.nio.ByteBuffer buf)</code></th> |
| <td class="colLast"> |
| <div class="block">Check for a non null and non empty buffer.</div> |
| </td> |
| </tr> |
| <tr id="i17" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEmpty(java.nio.ByteBuffer)">isEmpty</a></span>​(java.nio.ByteBuffer buf)</code></th> |
| <td class="colLast"> |
| <div class="block">Check for an empty or null buffer.</div> |
| </td> |
| </tr> |
| <tr id="i18" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEmpty(java.nio.ByteBuffer%5B%5D)">isEmpty</a></span>​(java.nio.ByteBuffer[] buf)</code></th> |
| <td class="colLast"> |
| <div class="block">Check for an empty or null buffers.</div> |
| </td> |
| </tr> |
| <tr id="i19" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isFull(java.nio.ByteBuffer)">isFull</a></span>​(java.nio.ByteBuffer buf)</code></th> |
| <td class="colLast"> |
| <div class="block">Check for a non null and full buffer.</div> |
| </td> |
| </tr> |
| <tr id="i20" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isPrefix(java.nio.ByteBuffer,java.nio.ByteBuffer)">isPrefix</a></span>​(java.nio.ByteBuffer prefix, |
| java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isTheEmptyBuffer(java.nio.ByteBuffer)">isTheEmptyBuffer</a></span>​(java.nio.ByteBuffer buf)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i22" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#length(java.nio.ByteBuffer)">length</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Get remaining from null checked buffer</div> |
| </td> |
| </tr> |
| <tr id="i23" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#put(java.nio.ByteBuffer,java.nio.ByteBuffer)">put</a></span>​(java.nio.ByteBuffer from, |
| java.nio.ByteBuffer to)</code></th> |
| <td class="colLast"> |
| <div class="block">Put data from one buffer into another, avoiding over/under flows</div> |
| </td> |
| </tr> |
| <tr id="i24" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#putCRLF(java.nio.ByteBuffer)">putCRLF</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i25" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#putDecInt(java.nio.ByteBuffer,int)">putDecInt</a></span>​(java.nio.ByteBuffer buffer, |
| int n)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i26" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#putDecLong(java.nio.ByteBuffer,long)">putDecLong</a></span>​(java.nio.ByteBuffer buffer, |
| long n)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i27" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#putHexInt(java.nio.ByteBuffer,int)">putHexInt</a></span>​(java.nio.ByteBuffer buffer, |
| int n)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i28" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#putIntLittleEndian(java.nio.ByteBuffer,int)">putIntLittleEndian</a></span>​(java.nio.ByteBuffer buffer, |
| int value)</code></th> |
| <td class="colLast"> |
| <div class="block">Put an integer little endian</div> |
| </td> |
| </tr> |
| <tr id="i29" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readFrom(java.io.File,java.nio.ByteBuffer)">readFrom</a></span>​(java.io.File file, |
| java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i30" class="altColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readFrom(java.io.InputStream,int,java.nio.ByteBuffer)">readFrom</a></span>​(java.io.InputStream is, |
| int needed, |
| java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i31" class="rowColor"> |
| <td class="colFirst"><code>static long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#remaining(java.nio.ByteBuffer...)">remaining</a></span>​(java.nio.ByteBuffer... buf)</code></th> |
| <td class="colLast"> |
| <div class="block">Get the remaining bytes in 0 or more buffers.</div> |
| </td> |
| </tr> |
| <tr id="i32" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#space(java.nio.ByteBuffer)">space</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Get the space from the limit to the capacity</div> |
| </td> |
| </tr> |
| <tr id="i33" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#takeInt(java.nio.ByteBuffer)">takeInt</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert buffer to an integer.</div> |
| </td> |
| </tr> |
| <tr id="i34" class="altColor"> |
| <td class="colFirst"><code>static byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toArray(java.nio.ByteBuffer)">toArray</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert a ByteBuffer to a byte array.</div> |
| </td> |
| </tr> |
| <tr id="i35" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(byte%5B%5D)">toBuffer</a></span>​(byte[] array)</code></th> |
| <td class="colLast"> |
| <div class="block">Create a new ByteBuffer using provided byte array.</div> |
| </td> |
| </tr> |
| <tr id="i36" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(byte%5B%5D,int,int)">toBuffer</a></span>​(byte[] array, |
| int offset, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Create a new ByteBuffer using the provided byte array.</div> |
| </td> |
| </tr> |
| <tr id="i37" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(int)">toBuffer</a></span>​(int value)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i38" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(long)">toBuffer</a></span>​(long value)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i39" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(java.lang.String)">toBuffer</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i40" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(java.lang.String,java.nio.charset.Charset)">toBuffer</a></span>​(java.lang.String s, |
| java.nio.charset.Charset charset)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i41" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toBuffer(org.eclipse.jetty.util.resource.Resource,boolean)">toBuffer</a></span>​(<a href="resource/Resource.html" title="class in org.eclipse.jetty.util.resource">Resource</a> resource, |
| boolean direct)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i42" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toDetailString(java.nio.ByteBuffer)">toDetailString</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert Buffer to a detail debug string of pointers and content</div> |
| </td> |
| </tr> |
| <tr id="i43" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toDetailString(java.nio.ByteBuffer%5B%5D)">toDetailString</a></span>​(java.nio.ByteBuffer[] buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i44" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toDirectBuffer(java.lang.String)">toDirectBuffer</a></span>​(java.lang.String s)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i45" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toDirectBuffer(java.lang.String,java.nio.charset.Charset)">toDirectBuffer</a></span>​(java.lang.String s, |
| java.nio.charset.Charset charset)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i46" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toHexString(java.nio.ByteBuffer)">toHexString</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert buffer to a Hex String.</div> |
| </td> |
| </tr> |
| <tr id="i47" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toHexSummary(java.nio.ByteBuffer)">toHexSummary</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert buffer to a Hex Summary String.</div> |
| </td> |
| </tr> |
| <tr id="i48" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toIDString(java.nio.ByteBuffer)">toIDString</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert Buffer to string ID independent of content</div> |
| </td> |
| </tr> |
| <tr id="i49" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toInt(java.nio.ByteBuffer)">toInt</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert buffer to an integer.</div> |
| </td> |
| </tr> |
| <tr id="i50" class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toInt(java.nio.ByteBuffer,int,int)">toInt</a></span>​(java.nio.ByteBuffer buffer, |
| int position, |
| int length)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert buffer to an integer.</div> |
| </td> |
| </tr> |
| <tr id="i51" class="rowColor"> |
| <td class="colFirst"><code>static long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toLong(java.nio.ByteBuffer)">toLong</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert buffer to an long.</div> |
| </td> |
| </tr> |
| <tr id="i52" class="altColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMappedBuffer(java.io.File)">toMappedBuffer</a></span>​(java.io.File file)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i53" class="rowColor"> |
| <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMappedBuffer(java.nio.file.Path,long,long)">toMappedBuffer</a></span>​(java.nio.file.Path filePath, |
| long pos, |
| long len)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i54" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString(java.nio.ByteBuffer)">toString</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert the buffer to an ISO-8859-1 String</div> |
| </td> |
| </tr> |
| <tr id="i55" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString(java.nio.ByteBuffer,int,int,java.nio.charset.Charset)">toString</a></span>​(java.nio.ByteBuffer buffer, |
| int position, |
| int length, |
| java.nio.charset.Charset charset)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert a partial buffer to a String.</div> |
| </td> |
| </tr> |
| <tr id="i56" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString(java.nio.ByteBuffer,java.nio.charset.Charset)">toString</a></span>​(java.nio.ByteBuffer buffer, |
| java.nio.charset.Charset charset)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert the buffer to an ISO-8859-1 String</div> |
| </td> |
| </tr> |
| <tr id="i57" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toSummaryString(java.nio.ByteBuffer)">toSummaryString</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i58" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toUTF8String(java.nio.ByteBuffer)">toUTF8String</a></span>​(java.nio.ByteBuffer buffer)</code></th> |
| <td class="colLast"> |
| <div class="block">Convert the buffer to an UTF-8 String</div> |
| </td> |
| </tr> |
| <tr id="i59" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeTo(java.nio.ByteBuffer,java.io.OutputStream)">writeTo</a></span>​(java.nio.ByteBuffer buffer, |
| java.io.OutputStream out)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="EMPTY_BUFFER"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>EMPTY_BUFFER</h4> |
| <pre>public static final java.nio.ByteBuffer EMPTY_BUFFER</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>BufferUtil</h4> |
| <pre>public BufferUtil()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="allocate(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>allocate</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer allocate​(int capacity)</pre> |
| <div class="block">Allocate ByteBuffer in flush mode. |
| The position and limit will both be zero, indicating that the buffer is |
| empty and must be flipped before any data is put to it.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>capacity</code> - capacity of the allocated ByteBuffer</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Buffer</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="allocateDirect(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>allocateDirect</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer allocateDirect​(int capacity)</pre> |
| <div class="block">Allocate ByteBuffer in flush mode. |
| The position and limit will both be zero, indicating that the buffer is |
| empty and in flush mode.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>capacity</code> - capacity of the allocated ByteBuffer</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Buffer</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="allocate(int,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>allocate</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer allocate​(int capacity, |
| boolean direct)</pre> |
| <div class="block">Allocates a ByteBuffer in flush mode. |
| The position and limit will both be zero, indicating that the buffer is |
| empty and must be flipped before any data is put to it.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>capacity</code> - capacity of the allocated ByteBuffer</dd> |
| <dd><code>direct</code> - whether the ByteBuffer is direct</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the newly allocated ByteBuffer</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="copy(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copy</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer copy​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Deep copy of a buffer</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to copy</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A copy of the buffer</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="clear(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clear</h4> |
| <pre class="methodSignature">public static void clear​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Clear the buffer to be empty in flush mode. |
| The position and limit are set to 0;</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to clear.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="clearToFill(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clearToFill</h4> |
| <pre class="methodSignature">public static void clearToFill​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Clear the buffer to be empty in fill mode. |
| The position is set to 0 and the limit is set to the capacity.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to clear.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="flipToFill(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>flipToFill</h4> |
| <pre class="methodSignature">public static int flipToFill​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Flip the buffer to fill mode. |
| The position is set to the first unused position in the buffer |
| (the old limit) and the limit is set to the capacity. |
| If the buffer is empty, then this call is effectively <a href="#clearToFill(java.nio.ByteBuffer)"><code>clearToFill(ByteBuffer)</code></a>. |
| If there is no unused space to fill, a <code>ByteBuffer.compact()</code> is done to attempt |
| to create space. |
| <p> |
| This method is used as a replacement to <code>ByteBuffer.compact()</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to flip</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The position of the valid data before the flipped position. This value should be |
| passed to a subsequent call to <a href="#flipToFlush(java.nio.ByteBuffer,int)"><code>flipToFlush(ByteBuffer, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="flipToFlush(java.nio.ByteBuffer,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>flipToFlush</h4> |
| <pre class="methodSignature">public static void flipToFlush​(java.nio.ByteBuffer buffer, |
| int position)</pre> |
| <div class="block">Flip the buffer to Flush mode. |
| The limit is set to the first unused byte(the old position) and |
| the position is set to the passed position. |
| <p> |
| This method is used as a replacement of <code>Buffer.flip()</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to be flipped</dd> |
| <dd><code>position</code> - The position of valid data to flip to. This should |
| be the return value of the previous call to <a href="#flipToFill(java.nio.ByteBuffer)"><code>flipToFill(ByteBuffer)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="putIntLittleEndian(java.nio.ByteBuffer,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putIntLittleEndian</h4> |
| <pre class="methodSignature">public static void putIntLittleEndian​(java.nio.ByteBuffer buffer, |
| int value)</pre> |
| <div class="block">Put an integer little endian</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to put to</dd> |
| <dd><code>value</code> - The value to put.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toArray(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toArray</h4> |
| <pre class="methodSignature">public static byte[] toArray​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert a ByteBuffer to a byte array.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to convert in flush mode. The buffer is not altered.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>An array of bytes duplicated from the buffer.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isTheEmptyBuffer(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isTheEmptyBuffer</h4> |
| <pre class="methodSignature">public static boolean isTheEmptyBuffer​(java.nio.ByteBuffer buf)</pre> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to check</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if buf is equal to EMPTY_BUFFER</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isEmpty(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre class="methodSignature">public static boolean isEmpty​(java.nio.ByteBuffer buf)</pre> |
| <div class="block">Check for an empty or null buffer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to check</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the buffer is null or empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isEmpty(java.nio.ByteBuffer[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre class="methodSignature">public static boolean isEmpty​(java.nio.ByteBuffer[] buf)</pre> |
| <div class="block">Check for an empty or null buffers.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to check</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the buffer is null or empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="remaining(java.nio.ByteBuffer...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>remaining</h4> |
| <pre class="methodSignature">public static long remaining​(java.nio.ByteBuffer... buf)</pre> |
| <div class="block">Get the remaining bytes in 0 or more buffers.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffers to check</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>number of bytes remaining in all buffers.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="hasContent(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasContent</h4> |
| <pre class="methodSignature">public static boolean hasContent​(java.nio.ByteBuffer buf)</pre> |
| <div class="block">Check for a non null and non empty buffer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to check</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the buffer is not null and not empty.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isFull(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isFull</h4> |
| <pre class="methodSignature">public static boolean isFull​(java.nio.ByteBuffer buf)</pre> |
| <div class="block">Check for a non null and full buffer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buf</code> - the buffer to check</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the buffer is not null and the limit equals the capacity.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="length(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>length</h4> |
| <pre class="methodSignature">public static int length​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Get remaining from null checked buffer</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to get the remaining from, in flush mode.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>0 if the buffer is null, else the bytes remaining in the buffer.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="space(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>space</h4> |
| <pre class="methodSignature">public static int space​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Get the space from the limit to the capacity</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to get the space from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>space</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="compact(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>compact</h4> |
| <pre class="methodSignature">public static boolean compact​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Compact the buffer</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to compact</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the compact made a full buffer have space</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="put(java.nio.ByteBuffer,java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>put</h4> |
| <pre class="methodSignature">public static int put​(java.nio.ByteBuffer from, |
| java.nio.ByteBuffer to)</pre> |
| <div class="block">Put data from one buffer into another, avoiding over/under flows</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>from</code> - Buffer to take bytes from in flush mode</dd> |
| <dd><code>to</code> - Buffer to put bytes to in fill mode.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>number of bytes moved</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.nio.ByteBuffer,byte[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static void append​(java.nio.ByteBuffer to, |
| byte[] b, |
| int off, |
| int len) |
| throws java.nio.BufferOverflowException</pre> |
| <div class="block">Append bytes to a buffer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>to</code> - Buffer is flush mode</dd> |
| <dd><code>b</code> - bytes to append</dd> |
| <dd><code>off</code> - offset into byte</dd> |
| <dd><code>len</code> - length to append</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.nio.BufferOverflowException</code> - if unable to append buffer due to space limits</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.nio.ByteBuffer,byte[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static void append​(java.nio.ByteBuffer to, |
| byte[] b) |
| throws java.nio.BufferOverflowException</pre> |
| <div class="block">Append bytes to a buffer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>to</code> - Buffer is flush mode</dd> |
| <dd><code>b</code> - bytes to append</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.nio.BufferOverflowException</code> - if unable to append buffer due to space limits</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.nio.ByteBuffer,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static void append​(java.nio.ByteBuffer to, |
| java.lang.String s) |
| throws java.nio.BufferOverflowException</pre> |
| <div class="block">Append a string to a buffer.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>to</code> - Buffer is flush mode</dd> |
| <dd><code>s</code> - String to append as UTF8</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.nio.BufferOverflowException</code> - if unable to append buffer due to space limits</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.nio.ByteBuffer,byte)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static void append​(java.nio.ByteBuffer to, |
| byte b)</pre> |
| <div class="block">Appends a byte to a buffer</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>to</code> - Buffer is flush mode</dd> |
| <dd><code>b</code> - byte to append</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.nio.BufferOverflowException</code> - if unable to append buffer due to space limits</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="append(java.nio.ByteBuffer,java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>append</h4> |
| <pre class="methodSignature">public static int append​(java.nio.ByteBuffer to, |
| java.nio.ByteBuffer b)</pre> |
| <div class="block">Appends a buffer to a buffer</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>to</code> - Buffer is flush mode</dd> |
| <dd><code>b</code> - buffer to append</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The position of the valid data before the flipped position.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fill(java.nio.ByteBuffer,byte[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fill</h4> |
| <pre class="methodSignature">public static int fill​(java.nio.ByteBuffer to, |
| byte[] b, |
| int off, |
| int len)</pre> |
| <div class="block">Like append, but does not throw <code>BufferOverflowException</code></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>to</code> - Buffer The buffer to fill to. The buffer will be flipped to fill mode and then flipped back to flush mode.</dd> |
| <dd><code>b</code> - bytes The bytes to fill</dd> |
| <dd><code>off</code> - offset into bytes</dd> |
| <dd><code>len</code> - length to fill</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of bytes taken from the buffer.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="readFrom(java.io.File,java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>readFrom</h4> |
| <pre class="methodSignature">public static void readFrom​(java.io.File file, |
| java.nio.ByteBuffer buffer) |
| throws java.io.IOException</pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="readFrom(java.io.InputStream,int,java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>readFrom</h4> |
| <pre class="methodSignature">public static void readFrom​(java.io.InputStream is, |
| int needed, |
| java.nio.ByteBuffer buffer) |
| throws java.io.IOException</pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="writeTo(java.nio.ByteBuffer,java.io.OutputStream)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>writeTo</h4> |
| <pre class="methodSignature">public static void writeTo​(java.nio.ByteBuffer buffer, |
| java.io.OutputStream out) |
| throws java.io.IOException</pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public static java.lang.String toString​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert the buffer to an ISO-8859-1 String</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to convert in flush mode. The buffer is unchanged</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The buffer as a string.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString(java.nio.ByteBuffer,java.nio.charset.Charset)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public static java.lang.String toString​(java.nio.ByteBuffer buffer, |
| java.nio.charset.Charset charset)</pre> |
| <div class="block">Convert the buffer to an ISO-8859-1 String</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to convert in flush mode. The buffer is unchanged</dd> |
| <dd><code>charset</code> - The <code>Charset</code> to use to convert the bytes</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The buffer as a string.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString(java.nio.ByteBuffer,int,int,java.nio.charset.Charset)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public static java.lang.String toString​(java.nio.ByteBuffer buffer, |
| int position, |
| int length, |
| java.nio.charset.Charset charset)</pre> |
| <div class="block">Convert a partial buffer to a String.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to convert</dd> |
| <dd><code>position</code> - The position in the buffer to start the string from</dd> |
| <dd><code>length</code> - The length of the buffer</dd> |
| <dd><code>charset</code> - The <code>Charset</code> to use to convert the bytes</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The buffer as a string.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toUTF8String(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toUTF8String</h4> |
| <pre class="methodSignature">public static java.lang.String toUTF8String​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert the buffer to an UTF-8 String</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - The buffer to convert in flush mode. The buffer is unchanged</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The buffer as a string.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toInt(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toInt</h4> |
| <pre class="methodSignature">public static int toInt​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert buffer to an integer. Parses up to the first non-numeric character. If no number is found an IllegalArgumentException is thrown</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - A buffer containing an integer in flush mode. The position is not changed.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an int</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toInt(java.nio.ByteBuffer,int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toInt</h4> |
| <pre class="methodSignature">public static int toInt​(java.nio.ByteBuffer buffer, |
| int position, |
| int length)</pre> |
| <div class="block">Convert buffer to an integer. Parses up to the first non-numeric character. If no number is found an |
| IllegalArgumentException is thrown</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - A buffer containing an integer in flush mode. The position is not changed.</dd> |
| <dd><code>position</code> - the position in the buffer to start reading from</dd> |
| <dd><code>length</code> - the length of the buffer to use for conversion</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an int of the buffer bytes</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="takeInt(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>takeInt</h4> |
| <pre class="methodSignature">public static int takeInt​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert buffer to an integer. Parses up to the first non-numeric character. If no number is found an IllegalArgumentException is thrown</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - A buffer containing an integer in flush mode. The position is updated.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an int</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toLong(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toLong</h4> |
| <pre class="methodSignature">public static long toLong​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert buffer to an long. Parses up to the first non-numeric character. If no number is found an IllegalArgumentException is thrown</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - A buffer containing an integer in flush mode. The position is not changed.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an int</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="putHexInt(java.nio.ByteBuffer,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putHexInt</h4> |
| <pre class="methodSignature">public static void putHexInt​(java.nio.ByteBuffer buffer, |
| int n)</pre> |
| </li> |
| </ul> |
| <a id="putDecInt(java.nio.ByteBuffer,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putDecInt</h4> |
| <pre class="methodSignature">public static void putDecInt​(java.nio.ByteBuffer buffer, |
| int n)</pre> |
| </li> |
| </ul> |
| <a id="putDecLong(java.nio.ByteBuffer,long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putDecLong</h4> |
| <pre class="methodSignature">public static void putDecLong​(java.nio.ByteBuffer buffer, |
| long n)</pre> |
| </li> |
| </ul> |
| <a id="toBuffer(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(int value)</pre> |
| </li> |
| </ul> |
| <a id="toBuffer(long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(long value)</pre> |
| </li> |
| </ul> |
| <a id="toBuffer(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(java.lang.String s)</pre> |
| </li> |
| </ul> |
| <a id="toBuffer(java.lang.String,java.nio.charset.Charset)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(java.lang.String s, |
| java.nio.charset.Charset charset)</pre> |
| </li> |
| </ul> |
| <a id="toBuffer(byte[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(byte[] array)</pre> |
| <div class="block">Create a new ByteBuffer using provided byte array.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>array</code> - the byte array to back buffer with.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>ByteBuffer with provided byte array, in flush mode</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toBuffer(byte[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(byte[] array, |
| int offset, |
| int length)</pre> |
| <div class="block">Create a new ByteBuffer using the provided byte array.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>array</code> - the byte array to use.</dd> |
| <dd><code>offset</code> - the offset within the byte array to use from</dd> |
| <dd><code>length</code> - the length in bytes of the array to use</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>ByteBuffer with provided byte array, in flush mode</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toBuffer(org.eclipse.jetty.util.resource.Resource,boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toBuffer​(<a href="resource/Resource.html" title="class in org.eclipse.jetty.util.resource">Resource</a> resource, |
| boolean direct) |
| throws java.io.IOException</pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toDirectBuffer(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toDirectBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toDirectBuffer​(java.lang.String s)</pre> |
| </li> |
| </ul> |
| <a id="toDirectBuffer(java.lang.String,java.nio.charset.Charset)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toDirectBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toDirectBuffer​(java.lang.String s, |
| java.nio.charset.Charset charset)</pre> |
| </li> |
| </ul> |
| <a id="toMappedBuffer(java.io.File)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toMappedBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toMappedBuffer​(java.io.File file) |
| throws java.io.IOException</pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toMappedBuffer(java.nio.file.Path,long,long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toMappedBuffer</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer toMappedBuffer​(java.nio.file.Path filePath, |
| long pos, |
| long len) |
| throws java.io.IOException</pre> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toSummaryString(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toSummaryString</h4> |
| <pre class="methodSignature">public static java.lang.String toSummaryString​(java.nio.ByteBuffer buffer)</pre> |
| </li> |
| </ul> |
| <a id="toDetailString(java.nio.ByteBuffer[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toDetailString</h4> |
| <pre class="methodSignature">public static java.lang.String toDetailString​(java.nio.ByteBuffer[] buffer)</pre> |
| </li> |
| </ul> |
| <a id="toDetailString(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toDetailString</h4> |
| <pre class="methodSignature">public static java.lang.String toDetailString​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert Buffer to a detail debug string of pointers and content</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to generate a detail string from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A string showing the pointers and content of the buffer</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toIDString(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toIDString</h4> |
| <pre class="methodSignature">public static java.lang.String toIDString​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert Buffer to string ID independent of content</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffet to generate a string ID from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A string showing the buffer ID</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toHexSummary(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toHexSummary</h4> |
| <pre class="methodSignature">public static java.lang.String toHexSummary​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert buffer to a Hex Summary String.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to generate a hex byte summary from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A string showing a summary of the content in hex</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toHexString(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toHexString</h4> |
| <pre class="methodSignature">public static java.lang.String toHexString​(java.nio.ByteBuffer buffer)</pre> |
| <div class="block">Convert buffer to a Hex String.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>buffer</code> - the buffer to generate a hex byte summary from</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A hex string</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="putCRLF(java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putCRLF</h4> |
| <pre class="methodSignature">public static void putCRLF​(java.nio.ByteBuffer buffer)</pre> |
| </li> |
| </ul> |
| <a id="isPrefix(java.nio.ByteBuffer,java.nio.ByteBuffer)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPrefix</h4> |
| <pre class="methodSignature">public static boolean isPrefix​(java.nio.ByteBuffer prefix, |
| java.nio.ByteBuffer buffer)</pre> |
| </li> |
| </ul> |
| <a id="ensureCapacity(java.nio.ByteBuffer,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ensureCapacity</h4> |
| <pre class="methodSignature">public static java.nio.ByteBuffer ensureCapacity​(java.nio.ByteBuffer buffer, |
| int capacity)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/BufferUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 1995–2021 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |