code: private static int appendByte(byte[] dst, int offset, long value) {
          if (value == 0) {
              return offset;
          }
          dst[offset] = (byte) value;
          return offset + 1;
      }
docs: Appends a byte if it's not a leading zero.