private void readHeader() { blockTimestamp = in.getLong(64); }
private void readHeader() { blockTimestamp = in.getLong(64); }
private void readHeader() { blockTimestamp = in.getLong(64); }
private void readHeader() { blockTimestamp = in.getLong(64); }
private void first() { // First item to read storedDelta = in.getLong(Compressor.FIRST_DELTA_BITS); if(storedDelta == (1<<27) - 1) { endOfStream = true; return; } storedVal = decompressor.readFirst(); // storedVal = in.getLong(64); storedTimestamp = blockTimestamp + storedDelta; }
public long readFirst() { long value = in.getLong(Long.SIZE); predictor.update(value); return value; }
public long readFirst() { long value = in.getLong(Long.SIZE); predictor.update(value); return value; }
private void first() { // First item to read storedDelta = in.getLong(Compressor.FIRST_DELTA_BITS); if(storedDelta == (1<<27) - 1) { endOfStream = true; return; } storedVal = decompressor.readFirst(); // storedVal = in.getLong(64); storedTimestamp = blockTimestamp + storedDelta; }
private void nextValue() { // Read value if (in.readBit()) { // else -> same value as before if (in.readBit()) { // New leading and trailing zeros storedLeadingZeros = (int) in.getLong(5); byte significantBits = (byte) in.getLong(6); if(significantBits == 0) { significantBits = 64; } storedTrailingZeros = 64 - significantBits - storedLeadingZeros; } long value = in.getLong(64 - storedLeadingZeros - storedTrailingZeros); value <<= storedTrailingZeros; value = storedVal ^ value; storedVal = value; } }
private void nextValue() { // Read value if (in.readBit()) { // else -> same value as before if (in.readBit()) { // New leading and trailing zeros storedLeadingZeros = (int) in.getLong(5); byte significantBits = (byte) in.getLong(6); if(significantBits == 0) { significantBits = 64; } storedTrailingZeros = 64 - significantBits - storedLeadingZeros; } long value = in.getLong(64 - storedLeadingZeros - storedTrailingZeros); value <<= storedTrailingZeros; value = storedVal ^ value; storedVal = value; } }
public long nextValue() { int val = in.nextClearBit(2); switch(val) { case 3: // New leading and trailing zeros storedLeadingZeros = (int) in.getLong(6); byte significantBits = (byte) in.getLong(6); significantBits++; storedTrailingZeros = Long.SIZE - significantBits - storedLeadingZeros; // missing break is intentional, we want to overflow to next one case 2: long value = in.getLong(Long.SIZE - storedLeadingZeros - storedTrailingZeros); value <<= storedTrailingZeros; value = predictor.predict() ^ value; predictor.update(value); return value; } return predictor.predict(); } }
public long nextValue() { int val = in.nextClearBit(2); switch(val) { case 3: // New leading and trailing zeros storedLeadingZeros = (int) in.getLong(6); byte significantBits = (byte) in.getLong(6); significantBits++; storedTrailingZeros = Long.SIZE - significantBits - storedLeadingZeros; // missing break is intentional, we want to overflow to next one case 2: long value = in.getLong(Long.SIZE - storedLeadingZeros - storedTrailingZeros); value <<= storedTrailingZeros; value = predictor.predict() ^ value; predictor.update(value); return value; } return predictor.predict(); } }
private void nextTimestamp() { // Next, read timestamp long deltaDelta = 0; int toRead = bitsToRead(); if (toRead > 0) { deltaDelta = in.getLong(toRead); if(toRead == 32) { if ((int) deltaDelta == 0xFFFFFFFF) { // End of stream endOfStream = true; return; } } else { // Turn "unsigned" long value back to signed one if(deltaDelta > (1 << (toRead - 1))) { deltaDelta -= (1 << toRead); } } deltaDelta = (int) deltaDelta; } storedDelta = storedDelta + deltaDelta; storedTimestamp = storedDelta + storedTimestamp; nextValue(); }
private void nextTimestamp() { // Next, read timestamp long deltaDelta = 0; int toRead = bitsToRead(); if (toRead > 0) { deltaDelta = in.getLong(toRead); if(toRead == 32) { if ((int) deltaDelta == 0xFFFFFFFF) { // End of stream endOfStream = true; return; } } else { // Turn "unsigned" long value back to signed one if(deltaDelta > (1 << (toRead - 1))) { deltaDelta -= (1 << toRead); } } deltaDelta = (int) deltaDelta; } storedDelta = storedDelta + deltaDelta; storedTimestamp = storedDelta + storedTimestamp; nextValue(); }