org.jikesrvm.util
Class StringUtilities

java.lang.Object
  extended by org.jikesrvm.util.StringUtilities

public class StringUtilities
extends Object


Constructor Summary
StringUtilities()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtilities

public StringUtilities()
Method Detail

stringToBytesNullTerminated

public 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. Allocates an additional null-terminator byte so that the resulting byte array can be passed to native C functions.

Parameters:
fileName - File name
Returns:
Byte-array representation

stringToBytes

public 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.

Parameters:
fileName - File name
Returns:
Byte-array representation

asciiBytesToString

public 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.

Parameters:
val - Byte array to convert
Returns:
The resulting string

asciiBytesToString

public 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.

Parameters:
val - Byte array to convert
start - Start the string at this byte
length - Use 'length' bytes
Returns:
The resulting string