Decodes a long value generated using {@link #encode} into a {@link CacheBucketOffset} instance.

@param value The encoded value.
@return A {@link CacheBucketOffset instance.}
515329
static CacheBucketOffset decode(long value) {
        return value < 0 ? new CacheBucketOffset(value ^ FIRST_BIT, true) : new CacheBucketOffset(value, false);
    }
1140078
public final Object encode(Val value) {
      if (value == null) {
         return null;
      }
      return encode(value.get());
   }
1113028
private BigInteger toBigInteger(Object value) {
		if (value instanceof Long) {
			return BigInteger.valueOf((Long) value);
		} else if(value instanceof Boolean) {
			return BigInteger.valueOf((boolean)value ? 1 : 0);
		}
		final String valueStr = convertToStr(value);
		if (StrUtil.isBlank(valueStr)) {
			return null;
		}
		return new BigInteger(valueStr);
	}
485330
public static long doubleToSortableLong(double value)
    {
        long bits = Double.doubleToLongBits(value);
        return bits ^ (bits >> 63) & Long.MAX_VALUE;
    }
1282552
public static String decodeToStr(String value) {
        byte[] decodedValue = delegate.decode(value);
        return new String(decodedValue, UTF_8);
    }
143530
private static StringBuilder toBase64(long value) {
		StringBuilder result = new StringBuilder(23); // Initialize with the size of ID if using Base64
		for(int shift=60; shift>=0; shift-=6) {
			result.append(Base64[(int)((value >> shift) & 0x3F)]);
		}
		return result;
	}
795729
public static String urlDecode(final String value) {
        if (value == null) {
            return null;
        }

        try {
            return URLDecoder.decode(value, DEFAULT_ENCODING);

        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
    }
778462
public static String base64Decode(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return new String(Base64.getDecoder().decode(value), StandardCharsets.UTF_8);
    }
614768
public static void encode(long value, byte[] dst, int dstOffset) {
        int w = ((int)(value >> 32)) ^ 0x80000000;
        dst[dstOffset    ] = (byte)(w >> 24);
        dst[dstOffset + 1] = (byte)(w >> 16);
        dst[dstOffset + 2] = (byte)(w >> 8);
        dst[dstOffset + 3] = (byte)w;
        w = (int)value;
        dst[dstOffset + 4] = (byte)(w >> 24);
        dst[dstOffset + 5] = (byte)(w >> 16);
        dst[dstOffset + 6] = (byte)(w >> 8);
        dst[dstOffset + 7] = (byte)w;
    }
1160033
public JBBPOut Long(final long... value) throws IOException {
    assertNotEnded();
    assertArrayNotNull(value);
    if (this.processCommands) {
      for (final long l : value) {
        _writeLong(l);
      }
    }
    return this;
  }
356222
@NonNull
    public Parameters setLong(@NonNull String name, long value) {
        return setValue(name, value);
    }
1081349
public static final BitSet toBitSet(final int size, final long value) {
    BitSet bits = new BitSet(size);
    int idx = 0;
    long tmp = value;
    while (tmp != 0L) {
      if (tmp % 2L != 0L) {
        bits.set(idx);
      }
      ++idx;
      tmp = tmp >>> 1;
    }
    return bits;
  }
253261
public static String base64Encode(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return Base64.getEncoder().encodeToString(value.getBytes(StandardCharsets.UTF_8));
    }
415529
protected V decode(String value) {
    return valueSerializer.decode(BaseEncoding.base16().decode(value));
  }
771268
protected long parseLong( String value ) {
        long factor = 1;
        if (value.endsWith("K")) {
            factor = KILO;
        } else if (value.endsWith("M")) {
            factor = MEGA;
        } else if (value.endsWith("G")) {
            factor = GIGA;
        }
        if (factor > 1) {
            value = value.substring(0, value.length() - 1);
        }
        return new BigInteger(value).longValue() * factor;
    }
783712
public static BigInteger read(String value) {
		if (!StringUtils.hasText(value)) return null;
		
		return new BigInteger(value);
	}
754088
public static String compressStringToBase64String(String value) throws IOException {
        return new String(Base64.encode(compressString(value)), StandardCharsets.UTF_8);
    }