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.

Method Index

 o asciiToInt(String)
Converts a string into an integer.
 o bytesToInt(byte[], int)
Convert four bytes of a byte array into an integer.
 o bytesToShort(byte[], int)
Returns a short from two bytes of a byte array.
 o deQuoteDePrint(String)
Replaces quotable-printable characters with their equivalents.
 o getFileNameFromUser()
Display a FileDialog and return a full path name.
 o getHexValue(char)
Returns the hex value of a character.
 o intToAscii(int)
Convert an integer into a four character string.
 o javaPathToMacPath(String)
Convert a java-style file name into a Mac-style file name.
 o javaPathToWinPath(String)
Convert a java-style file name into a Win-style file name.
 o pascalBytesToString(byte[], int)
Read a pascal-style string from a byte array.

Methods

 o getFileNameFromUser
  public static String getFileNameFromUser()
Display a FileDialog and return a full path name. Returns null if the user chooses 'Cancel'.
 o 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
 o asciiToInt
  public final static int asciiToInt(String s)
Converts a string into an integer. The string must contain exactly 4 characters.
 o 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.
 o bytesToInt
  public final static int bytesToInt(byte record[],
                                     int offset)
Convert four bytes of a byte array into an integer. Big-endian.
 o pascalBytesToString
  public final static String pascalBytesToString(byte record[],
                                                 int offset)
Read a pascal-style string from a byte array.
 o javaPathToWinPath
  public final static String javaPathToWinPath(String javaPath)
Convert a java-style file name into a Win-style file name.
 o javaPathToMacPath
  public final static String javaPathToMacPath(String javaPath)
Convert a java-style file name into a Mac-style file name.
 o deQuoteDePrint
  public static String deQuoteDePrint(String srcStr)
Replaces quotable-printable characters with their equivalents.
 o 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