本文整理汇总了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);
}
示例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: 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;
}
}
示例4: readLong
import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
protected long readLong(ByteBuffer buffer)
{
return buffer.getLong();
}
示例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();
}
示例6: readLong
import org.apache.mina.common.ByteBuffer; //导入方法依赖的package包/类
public static long readLong(ByteBuffer buffer)
{
return buffer.getLong();
}