本文整理汇总了Java中com.sleepycat.bind.tuple.TupleOutput.writeByte方法的典型用法代码示例。如果您正苦于以下问题:Java TupleOutput.writeByte方法的具体用法?Java TupleOutput.writeByte怎么用?Java TupleOutput.writeByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.bind.tuple.TupleOutput
的用法示例。
在下文中一共展示了TupleOutput.writeByte方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例4: objectToData
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToData(Object obj, TupleOutput data) {
// write the data
// FIXME BUG in NEOFlow....ALL int should be unsigned int
NEOFlow f = (NEOFlow) obj;
data.writeInt(f.getPackets());
data.writeInt(f.getSize());
data.writeInt(f.getMin_packet_size());
data.writeInt(f.getMax_packet_size());
for (int i = 0; i < NEOFlow.MAX_HISTOGRAM_INDEX; ++i) {
data.writeInt(f.getHistogram(i));
}
data.writeUnsignedInt(f.getMinInterArrivalTime().getSeconds());
data.writeUnsignedInt(f.getMinInterArrivalTime().getMicroSeconds());
data.writeUnsignedInt(f.getMaxInterArrivalTime().getSeconds());
data.writeUnsignedInt(f.getMaxInterArrivalTime().getMicroSeconds());
data.writeByte(f.getTos());
data.writeUnsignedInt(f.getFragCount());
data.writeUnsignedByte(f.getMin_ttl());
data.writeUnsignedByte(f.getMax_ttl());
for (int i = 0; i < NEOFlow.NUM_TCP_FLAGS; ++i) {
data.writeInt(f.getTcpFlag(i));
}
data.writeUnsignedInt(f.getFirstSYNpackTime().getSeconds());
data.writeUnsignedInt(f.getFirstSYNpackTime().getMicroSeconds());
data.writeUnsignedInt(f.getFirstSYNACKpackTime().getSeconds());
data.writeUnsignedInt(f.getFirstSYNACKpackTime().getMicroSeconds());
data.writeUnsignedInt(f.getFirstACKpackTime().getSeconds());
data.writeUnsignedInt(f.getFirstACKpackTime().getMicroSeconds());
for (int i = 0; i < NEOFlow.NUM_TYPES; ++i) {
data.writeInt(f.getTypeCount(i));
}
}
示例5: setKey
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
/**
* Outputs an integer followed by pad bytes.
*/
private void setKey(DatabaseEntry entry, int val, int len) {
TupleOutput out = new TupleOutput();
out.writeInt(val);
for (int i = 0; i < len - 4; i += 1) {
out.writeByte(0);
}
TupleBase.outputToEntry(out, entry);
}
示例6: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToEntry(WebURL url, TupleOutput output) {
output.writeString(url.getURL());
output.writeInt(url.getDocid());
output.writeInt(url.getParentDocid());
output.writeString(url.getParentUrl());
output.writeShort(url.getDepth());
output.writeByte(url.getPriority());
output.writeString(url.getAnchor());
}
示例7: objectToEntry
import com.sleepycat.bind.tuple.TupleOutput; //导入方法依赖的package包/类
@Override
public void objectToEntry(RepNodeImpl mi, TupleOutput output) {
final BarrierState syncState = mi.getBarrierState();
mi.getNameIdPair().serialize(output);
output.writeByte(mi.getType().ordinal());
output.writeBoolean(mi.isQuorumAck());
output.writeBoolean(mi.isRemoved());
output.writeString(mi.getHostName());
output.writeInt(mi.getPort());
output.writeLong(syncState.getLastCBVLSN().getSequence());
output.writeLong(syncState.getBarrierTime());
output.writeInt(mi.getChangeVersion());
}