Class Strings

java.lang.Object
org.bouncycastle.util.Strings

public final class Strings extends Object
String utilities.
  • Constructor Details

    • Strings

      public Strings()
  • Method Details

    • fromUTF8ByteArray

      public static String fromUTF8ByteArray(byte[] bytes)
    • fromUTF8ByteArray

      public static String fromUTF8ByteArray(byte[] bytes, int off, int length)
    • toUTF8ByteArray

      public static byte[] toUTF8ByteArray(String string)
    • toUTF8ByteArray

      public static byte[] toUTF8ByteArray(char[] string)
    • toUTF8ByteArray

      public static void toUTF8ByteArray(char[] string, OutputStream sOut) throws IOException
      Throws:
      IOException
    • toUpperCase

      public static String toUpperCase(String string)
      A locale independent version of toUpperCase.
      Parameters:
      string - input to be converted
      Returns:
      a US Ascii uppercase version
    • toLowerCase

      public static String toLowerCase(String string)
      A locale independent version of toLowerCase.
      Parameters:
      string - input to be converted
      Returns:
      a US ASCII lowercase version
    • toByteArray

      public static byte[] toByteArray(char[] chars)
    • toByteArray

      public static byte[] toByteArray(String string)
    • toByteArray

      public static int toByteArray(String s, byte[] buf, int off)
    • constantTimeAreEqual

      public static boolean constantTimeAreEqual(String a, String b)
      Constant time string comparison.
      Parameters:
      a - a string.
      b - another string to compare to a.
      Returns:
      true if a and b represent the same string, false otherwise.
    • fromByteArray

      public static String fromByteArray(byte[] bytes)
      Convert an array of 8 bit characters into a string.
      Parameters:
      bytes - 8 bit characters.
      Returns:
      resulting String.
    • asCharArray

      public static char[] asCharArray(byte[] bytes)
      Do a simple conversion of an array of 8 bit characters into a string.
      Parameters:
      bytes - 8 bit characters.
      Returns:
      resulting String.
    • split

      public static String[] split(String input, char delimiter)
    • newList

      public static StringList newList()
    • lineSeparator

      public static String lineSeparator()