本文整理汇总了Java中org.apache.mina.common.ByteBuffer.getUnsignedShort方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuffer.getUnsignedShort方法的具体用法?Java ByteBuffer.getUnsignedShort怎么用?Java ByteBuffer.getUnsignedShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.mina.common.ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.getUnsignedShort方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ContentHeaderBody
import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
public ContentHeaderBody(ByteBuffer buffer, long size) throws AMQFrameDecodingException
{
classId = buffer.getUnsignedShort();
weight = buffer.getUnsignedShort();
bodySize = buffer.getLong();
int propertyFlags = buffer.getUnsignedShort();
ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.getInstance();
properties = factory.createContentHeaderProperties(classId, propertyFlags, buffer, (int)size - 14);
}
示例2: populateFromBuffer
import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
protected void populateFromBuffer(ByteBuffer buffer, long size)
throws AMQFrameDecodingException, AMQProtocolVersionException
{
classId = buffer.getUnsignedShort();
weight = buffer.getUnsignedShort();
bodySize = buffer.getLong();
int propertyFlags = buffer.getUnsignedShort();
ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.getInstance();
properties = factory.createContentHeaderProperties(classId, propertyFlags, buffer, (int)size - 14);
}
示例3: readUnsignedShort
import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
protected int readUnsignedShort(ByteBuffer buffer)
{
return buffer.getUnsignedShort(); //To change body of created methods use File | Settings | File Templates.
}
示例4: createAndPopulateFrame
import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
public AMQFrame createAndPopulateFrame(AMQMethodBodyFactory methodBodyFactory, ByteBuffer in)
throws AMQFrameDecodingException, AMQProtocolVersionException
{
final byte type = in.get();
BodyFactory bodyFactory;
if (type == AMQMethodBody.TYPE)
{
bodyFactory = methodBodyFactory;
}
else
{
bodyFactory = _bodiesSupported[type];
}
if (bodyFactory == null)
{
throw new AMQFrameDecodingException(null, "Unsupported frame type: " + type, null);
}
final int channel = in.getUnsignedShort();
final long bodySize = in.getUnsignedInt();
// bodySize can be zero
if ((channel < 0) || (bodySize < 0))
{
throw new AMQFrameDecodingException(null, "Undecodable frame: type = " + type + " channel = " + channel
+ " bodySize = " + bodySize, null);
}
AMQFrame frame = new AMQFrame(in, channel, bodySize, bodyFactory);
byte marker = in.get();
if ((marker & 0xFF) != 0xCE)
{
throw new AMQFrameDecodingException(null, "End of frame marker not found. Read " + marker + " length=" + bodySize
+ " type=" + type, null);
}
return frame;
}