本文整理匯總了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 );
}