docs: public long toLong() {
          byte[] data = getBytes();
          if (data == null || data.length <= 0 || data.length > 8) {
              // Assume that we're in a numeric context and that the user
              // made a typo entering a hex string.
              throw Error.error(ErrorCode.X_42585); // malformed numeric constant
          }
  
          byte[] dataWithLeadingZeros = new byte[] {0, 0, 0, 0, 0, 0, 0, 0};
          int lenDiff = 8 - data.length;
          for (int j = lenDiff; j < 8; ++j) {
              dataWithLeadingZeros[j] = data[j - lenDiff];
          }
  
          BigInteger bi = new BigInteger(dataWithLeadingZeros);
          return bi.longValue();
      }