Class StringUtils


  • public class StringUtils
    extends Object
    Some string utility methods.
    • Method Detail

      • convertBytesToHex

        @NotNull
        public static @NotNull String convertBytesToHex​(@NotNull
                                                        @org.jetbrains.annotations.NotNull byte[] value)
        Convert a byte array to a hex encoded string.
        Parameters:
        value - the byte array
        Returns:
        the hex encoded string
      • convertHexToBytes

        @NotNull
        public static @org.jetbrains.annotations.NotNull byte[] convertHexToBytes​(@NotNull
                                                                                  @NotNull String s)
        Convert a hex encoded string to a byte array.
        Parameters:
        s - the hex encoded string
        Returns:
        the byte array
      • estimateMemoryUsage

        public static int estimateMemoryUsage​(String s)
        Estimates the memory usage of the given string.
        Parameters:
        s - the string to estimate.
        Returns:
        the estimated memory usage.