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


Java IntWrapper类代码示例

本文整理汇总了Java中me.lemire.integercompression.IntWrapper的典型用法代码示例。如果您正苦于以下问题:Java IntWrapper类的具体用法?Java IntWrapper怎么用?Java IntWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: dec

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
@Override
public int dec(int[] in, int[] out, int outOffset, int len) {
    IntegerCODEC pfor;
    try {
        if (pool == null) {
            synchronized (this) {
                if (pool == null) {
                    pool = new GenericObjectPool<>(new FastPFORFactory());
                }
            }
        }
        pfor = pool.borrowObject();
    } catch (Exception ex) {
        LOG.log(Level.SEVERE, null, ex);
        return -1;
    }
    int nInts = in[0];
    IntWrapper inputoffset = new IntWrapper(1);
    IntWrapper outputoffset = new IntWrapper(outOffset);
    pfor.uncompress(in, inputoffset, nInts, out, outputoffset);
    pool.returnObject(pfor);

    return inputoffset.get();
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:25,代码来源:FastPFORVBCODEC.java

示例2: compress

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
@Override
public void compress(int[] in, IntWrapper inpos, int inlength, byte[] out,
		IntWrapper outpos) {

	int inOffset = inpos.get();
	int outOffset = outpos.get();
	
	writeUncompressedInt(inlength, out, outOffset);
	outOffset+=4;
	
	int offset = GroupVarint.compress(in, inOffset, inlength, out, outOffset);
	outOffset+=offset;
	inOffset+=inlength;
	
	inpos.set(inOffset);
	outpos.set(outOffset);
}
 
开发者ID:catenamatteo,项目名称:groupvarint,代码行数:18,代码来源:GV.java

示例3: uncompress

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
@Override
public void uncompress(byte[] in, IntWrapper inpos, int inlength,
		int[] out, IntWrapper outpos) {
	
	int inOffset = inpos.get();
	int outOffset = outpos.get();
	
	int len = readUncompressedInt(in, inOffset);
	inOffset+=4;
	
	int offset = GroupVarint.decompress(in, inOffset, out, outOffset, len);
	inOffset+=offset;
	outOffset+=len;
	
	inpos.set(inOffset);
	outpos.set(outOffset);
}
 
开发者ID:catenamatteo,项目名称:groupvarint,代码行数:18,代码来源:GV.java

示例4: co

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
@Override
public int[] co(int[] in, int offset, int len) {
    IntegerCODEC codec = supplier.get();
    int[] out = new int[len + 1024];
    IntWrapper inputoffset = new IntWrapper(offset);
    IntWrapper outputoffset = new IntWrapper(1);
    codec.compress(in, inputoffset, len, out, outputoffset);
    out[0] = outputoffset.get() - 1;
    out = Arrays.copyOf(out, outputoffset.get());
    add(len * Integer.BYTES, outputoffset.intValue() * Integer.BYTES);

    return out;
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:14,代码来源:LemireCODEC.java

示例5: dec

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
@Override
public int dec(int[] in, int[] out, int outOffset, int len) {
    IntegerCODEC codec = supplier.get();
    int nInts = in[0];
    IntWrapper inputoffset = new IntWrapper(1);
    IntWrapper outputoffset = new IntWrapper(outOffset);
    codec.uncompress(in, inputoffset, nInts, out, outputoffset);

    return inputoffset.get();
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:11,代码来源:LemireCODEC.java

示例6: co

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
@Override
public int[] co(int[] in, int offset, int len) {
    IntegerCODEC pfor;
    try {
        if (pool == null) {
            synchronized (this) {
                if (pool == null) {
                    pool = new GenericObjectPool<>(new FastPFORFactory());
                }
            }
        }
        pfor = pool.borrowObject();
    } catch (Exception ex) {
        LOG.log(Level.SEVERE, null, ex);
        return null;
    }
    int[] out = new int[len + 1024];
    IntWrapper inputoffset = new IntWrapper(offset);
    IntWrapper outputoffset = new IntWrapper(1);
    pfor.compress(in, inputoffset, len, out, outputoffset);
    out[0] = outputoffset.get() - 1;
    out = Arrays.copyOf(out, outputoffset.get());
    pool.returnObject(pfor);
    add(len * Integer.BYTES, outputoffset.intValue() * Integer.BYTES);

    return out;
}
 
开发者ID:RankSys,项目名称:RankSys,代码行数:28,代码来源:FastPFORVBCODEC.java

示例7: packInt

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
public static int[] packInt(int[] data) {
	int[] outBuf = new int[data.length * 4];
	IntWrapper inPos = new IntWrapper();
	IntWrapper outPos = new IntWrapper();
	codec.compress(data, inPos, data.length, outBuf, outPos);
	return Arrays.copyOf(outBuf, outPos.get());
}
 
开发者ID:PortfolioEffect,项目名称:PE-HFT-Java,代码行数:8,代码来源:ArrayUtil.java

示例8: unpackInt

import me.lemire.integercompression.IntWrapper; //导入依赖的package包/类
public static int[] unpackInt(int[] data, int len) {
	int[] outBuf = new int[len + 1024];
	IntWrapper inPos = new IntWrapper();
	IntWrapper outPos = new IntWrapper();
	codec.uncompress(data, inPos, data.length, outBuf, outPos);
	return Arrays.copyOf(outBuf, outPos.get());
}
 
开发者ID:PortfolioEffect,项目名称:PE-HFT-Java,代码行数:8,代码来源:ArrayUtil.java


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