Class StringUtil


  • public class StringUtil
    extends java.lang.Object
    Utility class to manipulate strings
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getHexString​(byte[] raw)
      Method to convert byte array to hexadecimal string
      static java.util.List<java.lang.String> getStringLines​(java.lang.String input)
      Method to tokenize a string by line breaks
      static boolean isNullOrEmpty​(java.lang.String val)
      Checks whether the given string is null or empty
      static long passwordHash​(java.lang.String password)
      Method to get the long hash from the password.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getHexString

        public static java.lang.String getHexString​(byte[] raw)
        Method to convert byte array to hexadecimal string
        Parameters:
        raw - Raw byte array
        Returns:
        Hex string
      • passwordHash

        public static long passwordHash​(java.lang.String password)
        Method to get the long hash from the password. This is used for seeding the random number generator
        Parameters:
        password - Password to hash
        Returns:
        Long hash of the password
      • getStringLines

        public static java.util.List<java.lang.String> getStringLines​(java.lang.String input)
                                                               throws OpenStegoException
        Method to tokenize a string by line breaks
        Parameters:
        input - Input string
        Returns:
        List of strings tokenized by line breaks
        Throws:
        OpenStegoException
      • isNullOrEmpty

        public static boolean isNullOrEmpty​(java.lang.String val)
        Checks whether the given string is null or empty
        Parameters:
        val - Input string
        Returns:
        flag