public static byte decompressHeaderBitCnt(final byte header) { return (byte) ((ArrayUtils.decompressBooleanSingleByte(header, 7) ? 16 : 0) + // (ArrayUtils.decompressBooleanSingleByte(header, 6) ? 8 : 0) + // (ArrayUtils.decompressBooleanSingleByte(header, 5) ? 4 : 0) + // (ArrayUtils.decompressBooleanSingleByte(header, 4) ? 2 : 0) + // (ArrayUtils.decompressBooleanSingleByte(header, 3) ? 1 : 0)); }
public static byte decompressHeaderBitCnt(final byte[] values) { return (byte) ((ArrayUtils.decompressBoolean(values, 7) ? 16 : 0) + // (ArrayUtils.decompressBoolean(values, 6) ? 8 : 0) + // (ArrayUtils.decompressBoolean(values, 5) ? 4 : 0) + // (ArrayUtils.decompressBoolean(values, 4) ? 2 : 0) + // (ArrayUtils.decompressBoolean(values, 3) ? 1 : 0)); }
public static byte compress( final boolean sequences, final boolean sorted, final boolean variable, final boolean unique, final int diff) { return ArrayUtils.compressBoolean(compressBits(sequences, sorted, variable, unique, diff))[0]; }
public static int decompressValue( final byte[] set, final AtomicInteger position, final byte numberBitLength, final boolean signed) { int result = 0; int valueType = 1; final int sign = signed && ArrayUtils.decompressBoolean(set, position.getAndIncrement()) ? -1 : 1; for (int x = 0; x < numberBitLength; x++) { if (position.get() < (set.length * 8) && ArrayUtils.decompressBoolean(set, position.get())) { result += valueType; } if (valueType == 1) { valueType = 2; } else { valueType *= 2; } position.incrementAndGet(); } return sign * result; }