java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/IntZigzagDecoder.java [62:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    currentCount--;
    return (n >>> 1) ^ -(n & 1); // back to two's-complement
  }

  private void getLengthAndNumber(ByteBuffer buffer) {
    this.length = ReadWriteForEncodingUtils.readUnsignedVarInt(buffer);
    this.number = ReadWriteForEncodingUtils.readUnsignedVarInt(buffer);
    // TODO maybe this.byteCache = buffer is faster, but not safe
    byte[] tmp = new byte[length];
    buffer.get(tmp, 0, length);
    this.byteCache = ByteBuffer.wrap(tmp);
  }

  @Override
  public boolean hasNext(ByteBuffer buffer) {
    if (currentCount > 0 || buffer.remaining() > 0) {
      return true;
    }
    return false;
  }

  @Override
  public void reset() {
    this.length = 0;
    this.number = 0;
    this.currentCount = 0;
    if (this.byteCache == null) {
      this.byteCache = ByteBuffer.allocate(0);
    } else {
      this.byteCache.position(0);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/tsfile/src/main/java/org/apache/tsfile/encoding/decoder/LongZigzagDecoder.java [70:98]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    currentCount--;
    return (n >>> 1) ^ -(n & 1); // back to two's-complement
  }

  private void getLengthAndNumber(ByteBuffer buffer) {
    this.length = ReadWriteForEncodingUtils.readUnsignedVarInt(buffer);
    this.number = ReadWriteForEncodingUtils.readUnsignedVarInt(buffer);
    byte[] tmp = new byte[length];
    buffer.get(tmp, 0, length);
    this.byteCache = ByteBuffer.wrap(tmp);
  }

  @Override
  public boolean hasNext(ByteBuffer buffer) {
    if (currentCount > 0 || buffer.remaining() > 0) {
      return true;
    }
    return false;
  }

  @Override
  public void reset() {
    this.length = 0;
    this.number = 0;
    this.currentCount = 0;
    if (this.byteCache == null) {
      this.byteCache = ByteBuffer.allocate(0);
    } else {
      this.byteCache.position(0);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



