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


Java ByteBuffer.getLong方法代码示例

本文整理汇总了Java中org.apache.mina.common.ByteBuffer.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuffer.getLong方法的具体用法?Java ByteBuffer.getLong怎么用?Java ByteBuffer.getLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.mina.common.ByteBuffer的用法示例。


在下文中一共展示了ByteBuffer.getLong方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: readObject

import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
/**
 * Read object from StreamMessage ByteBuffer content
 *
 * @param wrapMsgContent ByteBuffer which contains data
 * @param encoding       message encoding
 * @return Object extracted from ByteBuffer
 * @throws JMSException
 * @throws CharacterCodingException
 */
private Object readObject(ByteBuffer wrapMsgContent, String encoding)
        throws JMSException, CharacterCodingException {
    int position = wrapMsgContent.position();
    checkAvailable(1, wrapMsgContent);
    byte wireType = wrapMsgContent.get();
    Object result = null;
    try {
        switch (wireType) {
        case BOOLEAN_TYPE:
            checkAvailable(1, wrapMsgContent);
            result = wrapMsgContent.get() != 0;
            break;
        case BYTE_TYPE:
            checkAvailable(1, wrapMsgContent);
            result = wrapMsgContent.get();
            break;
        case BYTEARRAY_TYPE:
            checkAvailable(4, wrapMsgContent);
            int size = wrapMsgContent.getInt();
            if (size == -1) {
                result = null;
            } else {
                byteArrayRemaining = size;
                byte[] bytesResult = new byte[size];
                readBytesImpl(wrapMsgContent, bytesResult);
                result = bytesResult;
            }
            break;
        case SHORT_TYPE:
            checkAvailable(2, wrapMsgContent);
            result = wrapMsgContent.getShort();
            break;
        case CHAR_TYPE:
            checkAvailable(2, wrapMsgContent);
            result = wrapMsgContent.getChar();
            break;
        case INT_TYPE:
            checkAvailable(4, wrapMsgContent);
            result = wrapMsgContent.getInt();
            break;
        case LONG_TYPE:
            checkAvailable(8, wrapMsgContent);
            result = wrapMsgContent.getLong();
            break;
        case FLOAT_TYPE:
            checkAvailable(4, wrapMsgContent);
            result = wrapMsgContent.getFloat();
            break;
        case DOUBLE_TYPE:
            checkAvailable(8, wrapMsgContent);
            result = wrapMsgContent.getDouble();
            break;
        case NULL_STRING_TYPE:
            result = null;
            break;
        case STRING_TYPE:
            checkAvailable(1, wrapMsgContent);
            result = wrapMsgContent.getString(Charset.forName(encoding).newDecoder());
            break;
        }
        return result;
    } catch (RuntimeException e) {
        wrapMsgContent.position(position);
        throw e;
    }
}
 
开发者ID:wso2,项目名称:andes,代码行数:76,代码来源:QueueManagementInformationMBean.java

示例4: readLong

import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
protected long readLong(ByteBuffer buffer)
{
    return buffer.getLong();
}
 
开发者ID:wso2,项目名称:andes,代码行数:5,代码来源:AMQMethodBodyImpl.java

示例5: readTimestamp

import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
public static long readTimestamp(ByteBuffer buffer)
{
    // Discard msb from AMQ timestamp
    // buffer.getUnsignedInt();
    return buffer.getLong();
}
 
开发者ID:wso2,项目名称:andes,代码行数:7,代码来源:EncodingUtils.java

示例6: readLong

import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
public static long readLong(ByteBuffer buffer)
{
    return buffer.getLong();
}
 
开发者ID:wso2,项目名称:andes,代码行数:5,代码来源:EncodingUtils.java


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