Package io.anyline.nfc.bouncycastle.util
Class Strings
-
- All Implemented Interfaces:
public final class Strings
String utilities.
-
-
Constructor Summary
Constructors Constructor Description Strings()
-
Method Summary
Modifier and Type Method Description static String
fromUTF8ByteArray(Array<byte> bytes)
static Array<byte>
toUTF8ByteArray(String string)
static Array<byte>
toUTF8ByteArray(Array<char> string)
static void
toUTF8ByteArray(Array<char> string, OutputStream sOut)
static String
toUpperCase(String string)
A locale independent version of toUpperCase. static String
toLowerCase(String string)
A locale independent version of toLowerCase. static Array<byte>
toByteArray(Array<char> chars)
static Array<byte>
toByteArray(String string)
static int
toByteArray(String s, Array<byte> buf, int off)
static boolean
constantTimeAreEqual(String a, String b)
Constant time string comparison. static String
fromByteArray(Array<byte> bytes)
Convert an array of 8 bit characters into a string. static Array<char>
asCharArray(Array<byte> bytes)
Do a simple conversion of an array of 8 bit characters into a string. static Array<String>
split(String input, char delimiter)
static StringList
newList()
static String
lineSeparator()
-
-
Method Detail
-
fromUTF8ByteArray
static String fromUTF8ByteArray(Array<byte> bytes)
-
toUTF8ByteArray
static Array<byte> toUTF8ByteArray(String string)
-
toUTF8ByteArray
static Array<byte> toUTF8ByteArray(Array<char> string)
-
toUTF8ByteArray
static void toUTF8ByteArray(Array<char> string, OutputStream sOut)
-
toUpperCase
static String toUpperCase(String string)
A locale independent version of toUpperCase.
- Parameters:
string
- input to be converted- Returns:
a US Ascii uppercase version
-
toLowerCase
static String toLowerCase(String string)
A locale independent version of toLowerCase.
- Parameters:
string
- input to be converted- Returns:
a US ASCII lowercase version
-
toByteArray
static Array<byte> toByteArray(Array<char> chars)
-
toByteArray
static Array<byte> toByteArray(String string)
-
toByteArray
static int toByteArray(String s, Array<byte> buf, int off)
-
constantTimeAreEqual
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
static String fromByteArray(Array<byte> bytes)
Convert an array of 8 bit characters into a string.
- Parameters:
bytes
- 8 bit characters.- Returns:
resulting String.
-
asCharArray
static Array<char> asCharArray(Array<byte> bytes)
Do a simple conversion of an array of 8 bit characters into a string.
- Parameters:
bytes
- 8 bit characters.- Returns:
resulting String.
-
newList
static StringList newList()
-
lineSeparator
static String lineSeparator()
-
-
-
-