本文整理汇总了Java中me.lemire.integercompression.IntWrapper.get方法的典型用法代码示例。如果您正苦于以下问题:Java IntWrapper.get方法的具体用法?Java IntWrapper.get怎么用?Java IntWrapper.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类me.lemire.integercompression.IntWrapper
的用法示例。
在下文中一共展示了IntWrapper.get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}