code: public BinaryEncoder writeLong(long l) throws IOException {
      // Compute the zig-zag value. First double the value and flip the bit if the input is negative.
      long val = (l << 1) ^ (l >> 63);
  
      if ((val & ~0x7f) != 0) {
        output.write((int) (0x80 | val & 0x7f));
        val >>>= 7;
        while (val > 0x7f) {
          output.write((int) (0x80 | val & 0x7f));
          val >>>= 7;
        }
      }
      output.write((int) val);
  
      return this;
    }
docs: write a single long int value.
  @throws java.io.IOException If there is IO error.