public class StringUtilities extends Object
Constructor and Description |
---|
StringUtilities() |
Modifier and Type | Method and Description |
---|---|
static String |
asciiBytesToString(byte[] val)
Convert a byte array to a
String assuming the ASCII
character set, for use in cases (such as early in the boot process)
where character set conversion is unavailable or inadvisable. |
static String |
asciiBytesToString(byte[] val,
int start,
int length)
Convert a byte array to a
String assuming the ASCII
character set, for use in cases (such as early in the boot process)
where character set conversion is unavailable or inadvisable. |
static byte[] |
stringToBytes(String fileName)
Convert a
String filename to a byte array using the
deprecated ascii String method for cases where passing it through
a character set converter is too heavyweight. |
static byte[] |
stringToBytesNullTerminated(String fileName)
Convert a
String filename to a byte array using the
deprecated ascii String method for cases where passing it through
a character set converter is too heavyweight. |
public StringUtilities()
public static byte[] stringToBytesNullTerminated(String fileName)
String
filename to a byte array using the
deprecated ascii String method for cases where passing it through
a character set converter is too heavyweight. Allocates an
additional null-terminator byte so that the resulting byte array
can be passed to native C functions.fileName
- File namepublic static byte[] stringToBytes(String fileName)
String
filename to a byte array using the
deprecated ascii String method for cases where passing it through
a character set converter is too heavyweight.fileName
- File namepublic static String asciiBytesToString(byte[] val)
String
assuming the ASCII
character set, for use in cases (such as early in the boot process)
where character set conversion is unavailable or inadvisable.val
- Byte array to convertpublic static String asciiBytesToString(byte[] val, int start, int length)
String
assuming the ASCII
character set, for use in cases (such as early in the boot process)
where character set conversion is unavailable or inadvisable.val
- Byte array to convertstart
- Start the string at this bytelength
- Use 'length' bytes