本文整理了Java中org.apache.mina.common.ByteBuffer.putShort()
方法的一些代码示例,展示了ByteBuffer.putShort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.putShort()
方法的具体详情如下:
包路径:org.apache.mina.common.ByteBuffer
类名称:ByteBuffer
方法名:putShort
暂无
代码示例来源:origin: org.apache.directory.mina/mina-core
public ByteBuffer putShort( int index, short value )
{
buf.putShort( index, value );
return this;
}
代码示例来源:origin: org.apache.directory.mina/mina-core
public ByteBuffer putShort( short value )
{
buf.putShort( value );
return this;
}
代码示例来源:origin: org.reddwarfserver.client/sgs-client
/**
* Prepends the length of the given byte array as a 2-byte {@code short}
* in network byte-order, and passes the result to the {@linkplain
* FilterListener#sendUnfiltered sendUnfiltered} method of the
* given {@code listener}.
*
* @param listener the {@code FilterListener} on which to send the data
* @param message the data to filter and forward to the listener
*/
void filterSend(FilterListener listener, byte[] message) {
ByteBuffer buffer = ByteBuffer.allocate(message.length + 2, false);
buffer.putShort((short) message.length);
buffer.put(message);
buffer.flip();
// Don't worry about the listener throwing an exception, since
// this method has no other side effects.
listener.sendUnfiltered(buffer);
}
}
代码示例来源:origin: org.apache.directory.mina/mina-core
putShort( (short)0 );
代码示例来源:origin: org.apache.directory.mina/mina-core
break;
case 2:
putShort( (short)0 );
break;
case 4:
break;
case 2:
putShort( oldPos - 2, (short)length );
break;
case 4:
代码示例来源:origin: org.apache.directory.mina/mina-core
putShort( shortValue );
内容来源于网络,如有侵权,请联系作者删除!