Class COM.tolstoy.jconfig.JUtils
All Packages Class Hierarchy This Package Previous Next Index
Class COM.tolstoy.jconfig.JUtils
java.lang.Object
|
+----COM.tolstoy.jconfig.JUtils
- public class JUtils
- extends Object
Contains various utility routines.
-
asciiToInt(String)
- Converts a string into an integer.
-
bytesToInt(byte[], int)
- Convert four bytes of a byte array into an integer.
-
bytesToShort(byte[], int)
- Returns a short from two bytes of a byte array.
-
deQuoteDePrint(String)
- Replaces quotable-printable characters with their equivalents.
-
getFileNameFromUser()
- Display a FileDialog and return a full path name.
-
getHexValue(char)
- Returns the hex value of a character.
-
intToAscii(int)
- Convert an integer into a four character string.
-
javaPathToMacPath(String)
- Convert a java-style file name into a Mac-style file name.
-
javaPathToWinPath(String)
- Convert a java-style file name into a Win-style file name.
-
pascalBytesToString(byte[], int)
- Read a pascal-style string from a byte array.
getFileNameFromUser
public static String getFileNameFromUser()
- Display a FileDialog and return a full path name. Returns null if the user chooses 'Cancel'.
bytesToShort
public final static short bytesToShort(byte buf[],
int offset)
- Returns a short from two bytes of a byte array. Big-endian.
- Parameters:
- offset - the offset at which to start
asciiToInt
public final static int asciiToInt(String s)
- Converts a string into an integer. The string must contain exactly 4 characters.
intToAscii
public final static String intToAscii(int n)
- Convert an integer into a four character string. If any characters would be zero,
they are replaced with spaces.
bytesToInt
public final static int bytesToInt(byte record[],
int offset)
- Convert four bytes of a byte array into an integer. Big-endian.
pascalBytesToString
public final static String pascalBytesToString(byte record[],
int offset)
- Read a pascal-style string from a byte array.
javaPathToWinPath
public final static String javaPathToWinPath(String javaPath)
- Convert a java-style file name into a Win-style file name.
javaPathToMacPath
public final static String javaPathToMacPath(String javaPath)
- Convert a java-style file name into a Mac-style file name.
deQuoteDePrint
public static String deQuoteDePrint(String srcStr)
- Replaces quotable-printable characters with their equivalents.
getHexValue
public final static int getHexValue(char cc)
- Returns the hex value of a character. Returns -1 if the character is not a hex character.
All Packages Class Hierarchy This Package Previous Next Index