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


Java ByteArrayConverter.fromByteArray方法代码示例

本文整理汇总了Java中org.hypergraphdb.storage.ByteArrayConverter.fromByteArray方法的典型用法代码示例。如果您正苦于以下问题:Java ByteArrayConverter.fromByteArray方法的具体用法?Java ByteArrayConverter.fromByteArray怎么用?Java ByteArrayConverter.fromByteArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hypergraphdb.storage.ByteArrayConverter的用法示例。


在下文中一共展示了ByteArrayConverter.fromByteArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IndexResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
/**
 * <p>Construct a result set matching a specific key.</p>
 * 
 * @param cursor
 * @param key
 */
public IndexResultSet(LmdbTxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter)
{
	checkArgNotNull(cursor, "cursor");
	
  this.converter = converter;
  this.cursor = cursor;
  this.key = new DatabaseEntry();
  this.data = new DatabaseEntry();
  if (keyIn != null)
  	assignData(this.key, keyIn.getData());

  try
 {
     cursor.cursor().get(CursorOp.GET_CURRENT, key, data);
     next = converter.fromByteArray(data.getData(), 0, data.getData().length);
     lookahead = 1;
 }
 catch (Throwable t)
 {
     throw new HGException(t);
 }
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:29,代码来源:IndexResultSet.java

示例2: SingleValueResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
public SingleValueResultSet(LmdbTxCursor cursor, DatabaseEntry keyIn,
		ByteArrayConverter<T> converter)
{
	this.converter = converter;
	this.cursor = cursor;
	this.key = new DatabaseEntry();
	this.data = new DatabaseEntry();
	if (keyIn != null)
		assignData(key, keyIn.getData());
	try
	{
		((SecondaryCursor) cursor.cursor()).get(CursorOp.GET_CURRENT, key,
				pkey, data);
		next = converter.fromByteArray(pkey.getData(), 0, pkey.getData().length);
		lookahead = 1;
	}
	catch (Throwable t)
	{
		throw new HGException(t);
	}

}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:23,代码来源:SingleValueResultSet.java

示例3: KeyScanResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
public KeyScanResultSet(LmdbTxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter)
{
    this.converter = converter;
    this.cursor = cursor;
    this.key = new DatabaseEntry();
    this.data = new DatabaseEntry();

    if (keyIn != null)
    	assignData(key, keyIn.getData());
  try
  {
      cursor.cursor().get(CursorOp.GET_CURRENT, key, data);
      next = converter.fromByteArray(key.getData(), 0, key.getData().length);
      lookahead = 1;
  }
  catch (Throwable t)
  {
      throw new HGException(t);
  }         
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:21,代码来源:KeyScanResultSet.java

示例4: IndexResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
/**
 * <p>
 * Construct a result set matching a specific key.
 * </p>
 * 
 * @param cursor
 * @param key
 */
public IndexResultSet(BJETxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter) {
	/*
	 * id = idcounter++; System.out.println("Constructing index set with id " + id); StackTraceElement
	 * e[]=Thread.currentThread().getStackTrace(); for (int i=0; i <e.length; i++) { System.out.println(e[i]);
	 * }
	 */
	this.converter = converter;
	this.cursor = cursor;
	this.key = new DatabaseEntry();
	
	if (keyIn != null) {
		assignData(this.key, keyIn.getData());
	}
	
	try {
		cursor.cursor().getCurrent(key, data, LockMode.DEFAULT);
		next = converter.fromByteArray(data.getData(), data.getOffset(), data.getSize());
		lookahead = 1;
	}
	catch (Throwable t) {
		throw new HGException(t);
	}
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:32,代码来源:IndexResultSet.java

示例5: SingleValueResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
public SingleValueResultSet(BJETxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter) {
	//
	// The following is bit hacky because we want to avoid some of the default behavior
	// of the super constructor, which is incorrect when the "values" we are interested in 
	// are the DB's primary keys. So we duplicate its bebavior and override instantiation
	// of the current value.
	this.converter = converter;
	this.cursor = cursor;
	this.key = new DatabaseEntry();
	if (keyIn != null) {
		assignData(key, keyIn.getData());
	}
	
	try {
		((SecondaryCursor)cursor.cursor()).getCurrent(key, pkey, data, LockMode.DEFAULT);
		next = converter.fromByteArray(pkey.getData(), pkey.getOffset(), pkey.getSize());
		lookahead = 1;
	}
	catch (Throwable t) {
		throw new HGException(t);
	}

}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:24,代码来源:SingleValueResultSet.java

示例6: KeyScanResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
public KeyScanResultSet(BJETxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter) {
	this.converter = converter;
	this.cursor = cursor;
	this.key = new DatabaseEntry();
	
	if (keyIn != null) {
		assignData(key, keyIn.getData());
	}
	
	try {
		cursor.cursor().getCurrent(key, data, LockMode.DEFAULT);
		next = converter.fromByteArray(key.getData(), key.getOffset(), key.getSize());
		lookahead = 1;
	}
	catch (Throwable t) {
		throw new HGException(t);
	}
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:19,代码来源:KeyScanResultSet.java

示例7: KeyScanResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
public KeyScanResultSet(BDBTxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter)
{
    this.converter = converter;
    this.cursor = cursor;
    this.key = new DatabaseEntry();
    this.data = new DatabaseEntry();
    // TODO: for fixed size key and data,we should actually reuse the buffers, but
    // this has to be passed somehow as a configuration parameter to the HGIndex
    // implementation and down to result sets. It's a worthwhile optimization.
    this.key.setReuseBuffer(false);
    this.data.setReuseBuffer(false);

    if (keyIn != null)
    	assignData(key, keyIn.getData());
 try
 {
     cursor.cursor().getCurrent(key, data, LockMode.DEFAULT);
     next = converter.fromByteArray(key.getData(), key.getOffset(), key.getSize());
     lookahead = 1;
 }
 catch (Throwable t)
 {
     throw new HGException(t);
 }         
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:26,代码来源:KeyScanResultSet.java

示例8: IndexResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
/**
     * <p>Construct a result set matching a specific key.</p>
     * 
     * @param cursor
     * @param key
     */
    public IndexResultSet(BDBTxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter)
    {
/*        id = idcounter++;
        System.out.println("Constructing index set with id " + id);
        StackTraceElement e[]=Thread.currentThread().getStackTrace();
        for (int i=0; i <e.length; i++) {
             System.out.println(e[i]);
            } */
        this.converter = converter;
        this.cursor = cursor;
        this.key = new DatabaseEntry();
        this.data = new DatabaseEntry();
        // TODO: for fixed size key and data,we should actually reuse the buffers, but
        // this has to be passed somehow as a configuration parameter to the HGIndex
        // implementation and down to result sets. It's a worthwhile optimization.
        this.key.setReuseBuffer(false);
        this.data.setReuseBuffer(false);
        if (keyIn != null)
        	assignData(this.key, keyIn.getData());
	    try
	    {
	        cursor.cursor().getCurrent(key, data, LockMode.DEFAULT);
	        next = converter.fromByteArray(data.getData(), data.getOffset(), data.getSize());
	        lookahead = 1;
	    }
	    catch (Throwable t)
	    {
	        throw new HGException(t);
	    }
    }
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:37,代码来源:IndexResultSet.java

示例9: SingleValueResultSet

import org.hypergraphdb.storage.ByteArrayConverter; //导入方法依赖的package包/类
public SingleValueResultSet(BDBTxCursor cursor, DatabaseEntry keyIn, ByteArrayConverter<T> converter)
{
    //
	// The following is bit hacky because we want to avoid some of the default behavior
	// of the super constructor, which is incorrect when the "values" we are interested in 
	// are the DB's primary keys. So we duplicate its behavior and override instantiation
	// of the current value.
    this.converter = converter;
    this.cursor = cursor;
    this.key = new DatabaseEntry();
    this.data = new DatabaseEntry();
    // TODO: for fixed size key and data,we should actually reuse the buffers, but
    // this has to be passed somehow as a configuration parameter to the HGIndex
    // implementation and down to result sets. It's a worthwhile optimization.
    this.key.setReuseBuffer(false);
    this.data.setReuseBuffer(false);
    if (keyIn != null)
    	assignData(key, keyIn.getData());        
 try
 {
     ((SecondaryCursor)cursor.cursor()).getCurrent(key, pkey, data, LockMode.DEFAULT);
     next = converter.fromByteArray(pkey.getData(), pkey.getOffset(), pkey.getSize());
     lookahead = 1;
 }
 catch (Throwable t)
 {
     throw new HGException(t);
 }       
    
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:31,代码来源:SingleValueResultSet.java


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