本文整理汇总了Java中com.sleepycat.bind.tuple.TupleInput.getBufferLength方法的典型用法代码示例。如果您正苦于以下问题:Java TupleInput.getBufferLength方法的具体用法?Java TupleInput.getBufferLength怎么用?Java TupleInput.getBufferLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.bind.tuple.TupleInput
的用法示例。
在下文中一共展示了TupleInput.getBufferLength方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
@Override
public Object entryToObject(TupleInput key) {
try {
//System.err.println("entryToObect called...");
if (key.getBufferLength() != 13) {
System.err.println("ERROR!!!!!!! buffer has " + key.getBufferLength() + " bytes!!");
}
FlowIDFlowIDKey flowIDFlowIDKey = new FlowIDFlowIDKey();
flowIDFlowIDKey.setProtocol(key.readByte());
flowIDFlowIDKey.setSourceIP(key.readUnsignedInt());
flowIDFlowIDKey.setDestinationIP(key.readUnsignedInt());
flowIDFlowIDKey.setSourcePort(key.readUnsignedShort());
flowIDFlowIDKey.setDestinationPort(key.readUnsignedShort());
return (Object) flowIDFlowIDKey;
} catch (Exception e) {
System.out.println("key input length: " + key.getBufferLength());
key.reset();
for (int i = 0; i < key.getBufferLength(); ++i) {
System.out.println((int) (key.readByte() & 0xFF));
}
e.printStackTrace();
return null;
}
}
示例2: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
public HGPersistentHandle[] entryToObject(TupleInput input) {
int size = input.getBufferLength() - input.getBufferOffset();
if (size % handleSize != 0) {
throw new HGException(
"While reading link tuple: the value buffer size is not a multiple of the handle size.");
}
else {
return readHandles(input.getBufferBytes(), 0, size);
}
}
示例3: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
public HGPersistentHandle[] entryToObject(TupleInput input)
{
int size = input.getBufferLength() - input.getBufferOffset();
if (size % handleSize != 0)
throw new HGException("While reading link tuple: the value buffer size is not a multiple of the handle size.");
else
return readHandles(input.getBufferBytes(), 0, size);
}
示例4: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
@Override
public Object entryToObject(TupleInput key) {
if (key.getBufferLength() != 4) {
System.err.println("ERROR!!!!!!! buffer has " + key.getBufferLength() + " bytes!!");
}
FlowIDHostKey flowIDHostKey = new FlowIDHostKey();
flowIDHostKey.setIP(key.readUnsignedInt());
return (Object) flowIDHostKey;
}
示例5: entryToObject
import com.sleepycat.bind.tuple.TupleInput; //导入方法依赖的package包/类
@Override
public Object entryToObject(TupleInput key) {
if (key.getBufferLength() != 4) {
System.err.println("ERROR!!!!!!! buffer has " + key.getBufferLength() + " bytes!!");
System.err.println(key.readByte() + " " + key.readByte());
}
FlowIDTimeKey flowIDEndTimeKey = new FlowIDTimeKey();
flowIDEndTimeKey.setEndTimeInterval(key.readUnsignedInt());
return (Object) flowIDEndTimeKey;
}