本文整理汇总了Java中org.apache.mina.core.buffer.IoBuffer.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java IoBuffer.getLong方法的具体用法?Java IoBuffer.getLong怎么用?Java IoBuffer.getLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.mina.core.buffer.IoBuffer
的用法示例。
在下文中一共展示了IoBuffer.getLong方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeData
import org.apache.mina.core.buffer.IoBuffer; //导入方法依赖的package包/类
private Object decodeData ( final IoBuffer data ) throws ProtocolCodecException
{
data.order ( ByteOrder.LITTLE_ENDIAN );
final byte dataType = data.get ();
switch ( dataType )
{
case 0:
return null;
case 1:
return data.get () != 0x00;
case 2:
return data.getInt ();
case 3:
return data.getLong ();
case 4:
return data.getFloat ();
default:
throw new ProtocolCodecException ( String.format ( "Data type %02x is unknown", dataType ) );
}
}
示例2: decodeDataUpdateEntry
import org.apache.mina.core.buffer.IoBuffer; //导入方法依赖的package包/类
private DataUpdate.Entry decodeDataUpdateEntry ( final IoBuffer data, final IoSession session ) throws ProtocolCodecException
{
final int register = data.getUnsignedShort ();
final byte missedUpdates = data.get ();
final long timestamp = data.getLong ();
final Set<DataUpdate.State> states = data.getEnumSetShort ( DataUpdate.State.class );
final Variant value = decodeVariant ( session, data );
return new DataUpdate.Entry ( register, value, timestamp, states, missedUpdates );
}
示例3: decodeLong
import org.apache.mina.core.buffer.IoBuffer; //导入方法依赖的package包/类
@Override
public Long decodeLong ( final IoBuffer buffer ) throws Exception
{
final byte type = checkType ( buffer, TYPE_LONG, true );
if ( type == TYPE_NULL )
{
return null;
}
else
{
return buffer.getLong ();
}
}
示例4: decodePrimitiveLong
import org.apache.mina.core.buffer.IoBuffer; //导入方法依赖的package包/类
@Override
public long decodePrimitiveLong ( final IoBuffer buffer ) throws Exception
{
checkType ( buffer, TYPE_LONG, false );
return buffer.getLong ();
}
示例5: get
import org.apache.mina.core.buffer.IoBuffer; //导入方法依赖的package包/类
@Override
public Long get ( final IoBuffer data, final int index )
{
return data.getLong ( index );
}