private void addHeader(long timestamp) { // One byte: length of the first delta // One byte: precision of timestamps out.writeBits(timestamp, 64); }
private void addHeader(long timestamp) { // One byte: length of the first delta // One byte: precision of timestamps out.writeBits(timestamp, 64); }
private void addHeader(long timestamp) { out.writeBits(timestamp, 64); }
private void addHeader(long timestamp) { out.writeBits(timestamp, 64); }
/** * store the length of the number of leading zeros in the next 5 bits * store length of the meaningful XORed value in the next 6 bits, * store the meaningful bits of the XORed value * (type b) * * @param xor XOR between previous value and current * @param leadingZeros New leading zeros * @param trailingZeros New trailing zeros */ private void writeNewLeading(long xor, int leadingZeros, int trailingZeros) { out.writeBit(); out.writeBits(leadingZeros, 5); // Number of leading zeros in the next 5 bits int significantBits = 64 - leadingZeros - trailingZeros; out.writeBits(significantBits, 6); // Length of meaningful bits in the next 6 bits out.writeBits(xor >>> trailingZeros, significantBits); // Store the meaningful bits of XOR storedLeadingZeros = leadingZeros; storedTrailingZeros = trailingZeros; } }
/** * store the length of the number of leading zeros in the next 5 bits * store length of the meaningful XORed value in the next 6 bits, * store the meaningful bits of the XORed value * (type b) * * @param xor XOR between previous value and current * @param leadingZeros New leading zeros * @param trailingZeros New trailing zeros */ private void writeNewLeading(long xor, int leadingZeros, int trailingZeros) { out.writeBit(); out.writeBits(leadingZeros, 5); // Number of leading zeros in the next 5 bits int significantBits = 64 - leadingZeros - trailingZeros; out.writeBits(significantBits, 6); // Length of meaningful bits in the next 6 bits out.writeBits(xor >>> trailingZeros, significantBits); // Store the meaningful bits of XOR storedLeadingZeros = leadingZeros; storedTrailingZeros = trailingZeros; } }
/** * If there at least as many leading zeros and as many trailing zeros as previous value, control bit = 0 (type a) * store the meaningful XORed value * * @param xor XOR between previous value and current */ private void writeExistingLeading(long xor) { out.skipBit(); int significantBits = 64 - storedLeadingZeros - storedTrailingZeros; xor >>>= storedTrailingZeros; out.writeBits(xor, significantBits); }
private void writeFirst(long timestamp, long value) { storedDelta = (int) (timestamp - blockTimestamp); storedTimestamp = timestamp; out.writeBits(storedDelta, FIRST_DELTA_BITS); valueCompressor.writeFirst(value); }
/** * If there at least as many leading zeros and as many trailing zeros as previous value, control bit = 0 (type a) * store the meaningful XORed value * * @param xor XOR between previous value and current */ private void writeExistingLeading(long xor) { out.skipBit(); int significantBits = 64 - storedLeadingZeros - storedTrailingZeros; xor >>>= storedTrailingZeros; out.writeBits(xor, significantBits); }
private void writeFirst(long timestamp, long value) { storedDelta = (int) (timestamp - blockTimestamp); storedTimestamp = timestamp; out.writeBits(storedDelta, FIRST_DELTA_BITS); valueCompressor.writeFirst(value); }
/** * If there at least as many leading zeros and as many trailing zeros as previous value, control bit = 0 (type a) * store the meaningful XORed value * * @param xor XOR between previous value and current */ private void writeExistingLeading(long xor) { out.skipBit(); int significantBits = 64 - storedLeadingZeros - storedTrailingZeros; out.writeBits(xor >>> storedTrailingZeros, significantBits); }
/** * If there at least as many leading zeros and as many trailing zeros as previous value, control bit = 0 (type a) * store the meaningful XORed value * * @param xor XOR between previous value and current */ private void writeExistingLeading(long xor) { out.skipBit(); int significantBits = 64 - storedLeadingZeros - storedTrailingZeros; out.writeBits(xor >>> storedTrailingZeros, significantBits); }
void writeFirst(long value) { predictor.update(value); out.writeBits(value, 64); }
void writeFirst(long value) { predictor.update(value); out.writeBits(value, 64); }