本文整理了Java中org.apache.mina.common.ByteBuffer.expand()
方法的一些代码示例,展示了ByteBuffer.expand()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.expand()
方法的具体详情如下:
包路径:org.apache.mina.common.ByteBuffer
类名称:ByteBuffer
方法名:expand
[英]Changes the capacity and limit of this buffer so this buffer get the specified expectedRemaining room from the current position. This method works even if you didn't set autoExpand to true.
[中]更改此缓冲区的容量和限制,以便此缓冲区从当前位置获取指定的ExpectedRemining room。即使未将“自动展开”设置为true,此方法也有效。
代码示例来源:origin: org.apache.directory.mina/mina-core
public ByteBuffer expand( int pos, int expectedRemaining )
{
buf.expand( pos, expectedRemaining );
return this;
}
代码示例来源:origin: org.apache.directory.mina/mina-core
public ByteBuffer expand( int expectedRemaining )
{
buf.expand( expectedRemaining );
return this;
}
代码示例来源:origin: org.apache.directory.mina/mina-core
/**
* Changes the capacity and limit of this buffer so this buffer get
* the specified <tt>expectedRemaining</tt> room from the current position.
* This method works even if you didn't set <tt>autoExpand</tt> to
* <tt>true</tt>.
*/
public ByteBuffer expand( int expectedRemaining )
{
return expand( position(), expectedRemaining );
}
代码示例来源:origin: org.apache.directory.mina/mina-core
/**
* This method forwards the call to {@link #expand(int)} only when
* <tt>autoExpand</tt> property is <tt>true</tt>.
*/
protected ByteBuffer autoExpand( int expectedRemaining )
{
if( isAutoExpand() )
{
expand( expectedRemaining );
}
return this;
}
代码示例来源:origin: org.apache.directory.mina/mina-core
/**
* This method forwards the call to {@link #expand(int)} only when
* <tt>autoExpand</tt> property is <tt>true</tt>.
*/
protected ByteBuffer autoExpand( int pos, int expectedRemaining )
{
if( isAutoExpand() )
{
expand( pos, expectedRemaining );
}
return this;
}
代码示例来源:origin: org.reddwarfserver.client/sgs-client
/**
* Processes network data of arbitrary length and dispatches zero or
* more complete messages to the given {@code listener}. If a partial
* message remains, it is buffered until more data is received.
*
* @param listener the {@code FilterListener} to receive complete messages
* @param buf the data to filter and optionally deliver to the
* {@code FilterListener}
*/
void filterReceive(FilterListener listener, ByteBuffer buf) {
logger.log(Level.FINEST,
"processing {0,number,#} bytes",
buf.remaining());
// Append the new data to the buffer
msgBuf.expand(buf.remaining());
msgBuf.put(buf);
msgBuf.flip();
processReceiveBuffer(listener);
}
内容来源于网络,如有侵权,请联系作者删除!