當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。