当前位置: 首页>>代码示例>>Java>>正文


Java TupleInput.getBufferLength方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:nologic,项目名称:nabs,代码行数:27,代码来源:FlowIDFlowIDKeyBinding.java

示例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);
	}
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:11,代码来源:LinkBinding.java

示例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);
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:9,代码来源:LinkBinding.java

示例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;
}
 
开发者ID:nologic,项目名称:nabs,代码行数:12,代码来源:FlowIDHostKeyBinding.java

示例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;
}
 
开发者ID:nologic,项目名称:nabs,代码行数:13,代码来源:FlowIDTimeKeyBinding.java


注:本文中的com.sleepycat.bind.tuple.TupleInput.getBufferLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。