本文整理汇总了Java中com.sleepycat.bind.tuple.TupleOutput.writeUnsignedShort方法的典型用法代码示例。如果您正苦于以下问题:Java TupleOutput.writeUnsignedShort方法的具体用法?Java TupleOutput.writeUnsignedShort怎么用?Java TupleOutput.writeUnsignedShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.bind.tuple.TupleOutput
的用法示例。
在下文中一共展示了TupleOutput.writeUnsignedShort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: objectToData
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToData(Object obj, TupleOutput data) {
try {
FlowID id = (FlowID) obj;
data.writeByte(id.getProtocol() & 0x000000FF);
data.writeUnsignedInt(id.getSourceIP());
data.writeUnsignedInt(id.getDestinationIP());
data.writeUnsignedShort(id.getSourcePort());
data.writeUnsignedShort(id.getDestinationPort());
data.writeUnsignedInt(id.getStartTimeSeconds());
data.writeUnsignedInt(id.getStartTimeMicroseconds());
data.writeUnsignedInt(id.getEndTimeSeconds());
data.writeUnsignedInt(id.getEndTimeMicroseconds());
data.write(padding);
} catch (IOException ex) {
ex.printStackTrace();
}
}
示例2: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToEntry(Object objKey, TupleOutput key) {
FlowIDFlowIDKey flowIDFlowIDKey = (FlowIDFlowIDKey) objKey;
key.writeByte(flowIDFlowIDKey.getProtocol());
key.writeUnsignedInt(flowIDFlowIDKey.getSourceIP());
key.writeUnsignedInt(flowIDFlowIDKey.getDestinationIP());
key.writeUnsignedShort(flowIDFlowIDKey.getSourcePort());
key.writeUnsignedShort(flowIDFlowIDKey.getDestinationPort());
}
示例3: objectToKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToKey(Object obj, TupleOutput key) {
// write the key
NEOFlow f = (NEOFlow) obj;
key.writeByte(f.getProtocol());
key.writeUnsignedShort(f.getSourcePort());
key.writeUnsignedShort(f.getDestinationPort());
key.writeUnsignedInt(f.getSourceIP());
key.writeUnsignedInt(f.getDestinationIP());
key.writeUnsignedInt(f.getStartTime().getSeconds());
key.writeUnsignedInt(f.getStartTime().getMicroSeconds());
key.writeUnsignedInt(f.getEndTime().getSeconds());
key.writeUnsignedInt(f.getEndTime().getMicroSeconds());
}