本文整理汇总了Java中com.sleepycat.bind.tuple.TupleOutput.write方法的典型用法代码示例。如果您正苦于以下问题:Java TupleOutput.write方法的具体用法?Java TupleOutput.write怎么用?Java TupleOutput.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.bind.tuple.TupleOutput
的用法示例。
在下文中一共展示了TupleOutput.write方法的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: createSecondaryKeys
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void createSecondaryKeys(TupleInput primaryKeyInput, TupleInput dataInput, Set<TupleOutput> indexKeys) {
try {
TupleOutput src = getTupleOutput(null);
TupleOutput dest = getTupleOutput(null);
dataInput.skipFast(1);
dataInput.read(ip);
src.write(ip);
dataInput.read(ip);
dest.write(ip);
indexKeys.add(src);
indexKeys.add(dest);
} catch (IOException ex) {
ex.printStackTrace();
}
}
示例3: createSecondaryKeys
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void createSecondaryKeys(TupleInput primaryKeyInput, TupleInput dataInput, Set<TupleOutput> indexKeys) {
try {
byte[] flowID = new byte[13];
TupleOutput id = getTupleOutput(null);
TupleOutput reverseID = getTupleOutput(null);
if (dataInput.read(flowID) != 13) {
System.err.println("WTF!?!?!?!?!??!?");
}
id.write(flowID, 0, 13);
reverseID.write(flowID, 0, 1);
reverseID.write(flowID, 5, 4);
reverseID.write(flowID, 1, 4);
reverseID.write(flowID, 11, 2);
reverseID.write(flowID, 9, 2);
if (id.getBufferLength() != 13) {
System.err.println("WTF??????? didn't write 13 bytes!!!!!!");
}
indexKeys.add(id);
if (reverseID.getBufferLength() != 13) {
System.err.println("WTF??????? didn't write 13 bytes for reverse!!!");
}
indexKeys.add(reverseID);
} catch (IOException ex) {
ex.printStackTrace();
}
}