📄 iobuffer.html
字号:
<a name="360" href="#360">360</a> <em class="jxr_javadoccomment"> * the new capacity of the buffer shrunk by {@link #compact()} and</em><a name="361" href="#361">361</a> <em class="jxr_javadoccomment"> * {@link #shrink()} operation. The default value is the initial capacity</em><a name="362" href="#362">362</a> <em class="jxr_javadoccomment"> * of the buffer.</em><a name="363" href="#363">363</a> <em class="jxr_javadoccomment"> */</em><a name="364" href="#364">364</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">int</strong> minimumCapacity();<a name="365" href="#365">365</a> <a name="366" href="#366">366</a> <em class="jxr_javadoccomment">/**</em><a name="367" href="#367">367</a> <em class="jxr_javadoccomment"> * Sets the minimum capacity of this buffer which is used to determine</em><a name="368" href="#368">368</a> <em class="jxr_javadoccomment"> * the new capacity of the buffer shrunk by {@link #compact()} and</em><a name="369" href="#369">369</a> <em class="jxr_javadoccomment"> * {@link #shrink()} operation. The default value is the initial capacity</em><a name="370" href="#370">370</a> <em class="jxr_javadoccomment"> * of the buffer.</em><a name="371" href="#371">371</a> <em class="jxr_javadoccomment"> */</em><a name="372" href="#372">372</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> minimumCapacity(<strong class="jxr_keyword">int</strong> minimumCapacity);<a name="373" href="#373">373</a> <a name="374" href="#374">374</a> <em class="jxr_javadoccomment">/**</em><a name="375" href="#375">375</a> <em class="jxr_javadoccomment"> * @see ByteBuffer#capacity()</em><a name="376" href="#376">376</a> <em class="jxr_javadoccomment"> */</em><a name="377" href="#377">377</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">int</strong> capacity();<a name="378" href="#378">378</a> <a name="379" href="#379">379</a> <em class="jxr_javadoccomment">/**</em><a name="380" href="#380">380</a> <em class="jxr_javadoccomment"> * Increases the capacity of this buffer. If the new capacity is less than</em><a name="381" href="#381">381</a> <em class="jxr_javadoccomment"> * or equal to the current capacity, this method returns silently. If the</em><a name="382" href="#382">382</a> <em class="jxr_javadoccomment"> * new capacity is greater than the current capacity, the buffer is</em><a name="383" href="#383">383</a> <em class="jxr_javadoccomment"> * reallocated while retaining the position, limit, mark and the content</em><a name="384" href="#384">384</a> <em class="jxr_javadoccomment"> * of the buffer.</em><a name="385" href="#385">385</a> <em class="jxr_javadoccomment"> */</em><a name="386" href="#386">386</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> capacity(<strong class="jxr_keyword">int</strong> newCapacity);<a name="387" href="#387">387</a> <a name="388" href="#388">388</a> <em class="jxr_javadoccomment">/**</em><a name="389" href="#389">389</a> <em class="jxr_javadoccomment"> * Returns <tt>true</tt> if and only if <tt>autoExpand</tt> is turned on.</em><a name="390" href="#390">390</a> <em class="jxr_javadoccomment"> */</em><a name="391" href="#391">391</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">boolean</strong> isAutoExpand();<a name="392" href="#392">392</a> <a name="393" href="#393">393</a> <em class="jxr_javadoccomment">/**</em><a name="394" href="#394">394</a> <em class="jxr_javadoccomment"> * Turns on or off <tt>autoExpand</tt>.</em><a name="395" href="#395">395</a> <em class="jxr_javadoccomment"> */</em><a name="396" href="#396">396</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> setAutoExpand(<strong class="jxr_keyword">boolean</strong> autoExpand);<a name="397" href="#397">397</a> <a name="398" href="#398">398</a> <em class="jxr_javadoccomment">/**</em><a name="399" href="#399">399</a> <em class="jxr_javadoccomment"> * Returns <tt>true</tt> if and only if <tt>autoShrink</tt> is turned on.</em><a name="400" href="#400">400</a> <em class="jxr_javadoccomment"> */</em><a name="401" href="#401">401</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">boolean</strong> isAutoShrink();<a name="402" href="#402">402</a> <a name="403" href="#403">403</a> <em class="jxr_javadoccomment">/**</em><a name="404" href="#404">404</a> <em class="jxr_javadoccomment"> * Turns on or off <tt>autoShrink</tt>.</em><a name="405" href="#405">405</a> <em class="jxr_javadoccomment"> */</em><a name="406" href="#406">406</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> setAutoShrink(<strong class="jxr_keyword">boolean</strong> autoShrink);<a name="407" href="#407">407</a> <a name="408" href="#408">408</a> <em class="jxr_javadoccomment">/**</em><a name="409" href="#409">409</a> <em class="jxr_javadoccomment"> * Changes the capacity and limit of this buffer so this buffer get</em><a name="410" href="#410">410</a> <em class="jxr_javadoccomment"> * the specified <tt>expectedRemaining</tt> room from the current position.</em><a name="411" href="#411">411</a> <em class="jxr_javadoccomment"> * This method works even if you didn't set <tt>autoExpand</tt> to</em><a name="412" href="#412">412</a> <em class="jxr_javadoccomment"> * <tt>true</tt>.</em><a name="413" href="#413">413</a> <em class="jxr_javadoccomment"> */</em><a name="414" href="#414">414</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> expand(<strong class="jxr_keyword">int</strong> expectedRemaining);<a name="415" href="#415">415</a> <a name="416" href="#416">416</a> <em class="jxr_javadoccomment">/**</em><a name="417" href="#417">417</a> <em class="jxr_javadoccomment"> * Changes the capacity and limit of this buffer so this buffer get</em><a name="418" href="#418">418</a> <em class="jxr_javadoccomment"> * the specified <tt>expectedRemaining</tt> room from the specified</em><a name="419" href="#419">419</a> <em class="jxr_javadoccomment"> * <tt>position</tt>.</em><a name="420" href="#420">420</a> <em class="jxr_javadoccomment"> * This method works even if you didn't set <tt>autoExpand</tt> to</em><a name="421" href="#421">421</a> <em class="jxr_javadoccomment"> * <tt>true</tt>.</em><a name="422" href="#422">422</a> <em class="jxr_javadoccomment"> */</em><a name="423" href="#423">423</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> expand(<strong class="jxr_keyword">int</strong> position, <strong class="jxr_keyword">int</strong> expectedRemaining);<a name="424" href="#424">424</a> <a name="425" href="#425">425</a> <em class="jxr_javadoccomment">/**</em><a name="426" href="#426">426</a> <em class="jxr_javadoccomment"> * Changes the capacity of this buffer so this buffer occupies as less</em><a name="427" href="#427">427</a> <em class="jxr_javadoccomment"> * memory as possible while retaining the position, limit and the</em><a name="428" href="#428">428</a> <em class="jxr_javadoccomment"> * buffer content between the position and limit. The capacity of the</em><a name="429" href="#429">429</a> <em class="jxr_javadoccomment"> * buffer never becomes less than {@link #minimumCapacity()}.</em><a name="430" href="#430">430</a> <em class="jxr_javadoccomment"> * The mark is discarded once the capacity changes.</em><a name="431" href="#431">431</a> <em class="jxr_javadoccomment"> */</em><a name="432" href="#432">432</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> shrink();<a name="433" href="#433">433</a> <a name="434" href="#434">434</a> <em class="jxr_javadoccomment">/**</em><a name="435" href="#435">435</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#position()</em><a name="436" href="#436">436</a> <em class="jxr_javadoccomment"> */</em><a name="437" href="#437">437</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">int</strong> position();<a name="438" href="#438">438</a> <a name="439" href="#439">439</a> <em class="jxr_javadoccomment">/**</em><a name="440" href="#440">440</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#position(int)</em><a name="441" href="#441">441</a> <em class="jxr_javadoccomment"> */</em><a name="442" href="#442">442</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> position(<strong class="jxr_keyword">int</strong> newPosition);<a name="443" href="#443">443</a> <a name="444" href="#444">444</a> <em class="jxr_javadoccomment">/**</em><a name="445" href="#445">445</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#limit()</em><a name="446" href="#446">446</a> <em class="jxr_javadoccomment"> */</em><a name="447" href="#447">447</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">int</strong> limit();<a name="448" href="#448">448</a> <a name="449" href="#449">449</a> <em class="jxr_javadoccomment">/**</em><a name="450" href="#450">450</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#limit(int)</em><a name="451" href="#451">451</a> <em class="jxr_javadoccomment"> */</em><a name="452" href="#452">452</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> limit(<strong class="jxr_keyword">int</strong> newLimit);<a name="453" href="#453">453</a> <a name="454" href="#454">454</a> <em class="jxr_javadoccomment">/**</em><a name="455" href="#455">455</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#mark()</em><a name="456" href="#456">456</a> <em class="jxr_javadoccomment"> */</em><a name="457" href="#457">457</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> mark();<a name="458" href="#458">458</a> <a name="459" href="#459">459</a> <em class="jxr_javadoccomment">/**</em><a name="460" href="#460">460</a> <em class="jxr_javadoccomment"> * Returns the position of the current mark. This method returns <tt>-1</tt> if no</em><a name="461" href="#461">461</a> <em class="jxr_javadoccomment"> * mark is set.</em><a name="462" href="#462">462</a> <em class="jxr_javadoccomment"> */</em><a name="463" href="#463">463</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">int</strong> markValue();<a name="464" href="#464">464</a> <a name="465" href="#465">465</a> <em class="jxr_javadoccomment">/**</em><a name="466" href="#466">466</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#reset()</em><a name="467" href="#467">467</a> <em class="jxr_javadoccomment"> */</em><a name="468" href="#468">468</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> reset();<a name="469" href="#469">469</a> <a name="470" href="#470">470</a> <em class="jxr_javadoccomment">/**</em><a name="471" href="#471">471</a> <em class="jxr_javadoccomment"> * @see java.nio.Buffer#clear()</em><a name="472" href="#472">472</a> <em class="jxr_javadoccomment"> */</em><a name="473" href="#473">473</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> clear();<a name="474" href="#474">474</a> <a name="475" href="#475">475</a> <em class="jxr_javadoccomment">/**</em><a name="476" href="#476">476</a> <em class="jxr_javadoccomment"> * Clears this buffer and fills its content with <tt>NUL</tt>.</em><a name="477" href="#477">477</a> <em class="jxr_javadoccomment"> * The position is set to zero, the limit is set to the capacity,</em><a name="478" href="#478">478</a> <em class="jxr_javadoccomment"> * and the mark is discarded.</em><a name="479" href="#479">479</a> <em class="jxr_javadoccomment"> */</em><a name="480" href="#480">480</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">abstract</strong> <a href="../../../../org/apache/mina/common/IoBuffer.html">IoBuffer</a> sweep();<a name="481" href="#481">481</a> <a name="482" href="#482">482</a> <em class="jxr_javadoccomment">/**</em>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -