当前位置: 首页>>代码示例>>Java>>正文


Java ByteBuffer.getUnsignedShort方法代码示例

本文整理汇总了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);

}
 
开发者ID:wso2,项目名称:andes,代码行数:11,代码来源:ContentHeaderBody.java

示例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);
}
 
开发者ID:wso2,项目名称:andes,代码行数:11,代码来源:ContentHeaderBody.java

示例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.
}
 
开发者ID:wso2,项目名称:andes,代码行数:5,代码来源:AMQMethodBodyImpl.java

示例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;
}
 
开发者ID:wso2,项目名称:andes,代码行数:42,代码来源:AMQDataBlockDecoder.java


注:本文中的org.apache.mina.common.ByteBuffer.getUnsignedShort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。