Main Page
Cookbook/Overview ImageMeister the jcprops file Licensing Binary Installation & Configuration [ Win · Mac · Nix · OSX ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix · OSX ] Distribution Issues |
All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----com.jconfig.JUtils
Summary |
public class JUtils extends java.lang.Object { // Fields 2 private static final String copyrightString; private static final char[] hexDigits; // Constructors 1 private JUtils(); // Methods 19 public static final int asciiToInt(String); public static final int bytesToInt(byte[], int); public static final int bytesToIntSwap(byte[], int); public static final short bytesToShort(byte[], int); public static final short bytesToShortSwap(byte[], int); public static String deQuoteDePrint(String); public static final String enQP(byte[]); public static final String enQP(String); public static String[] fileToStringArray(File); public static String getFileNameFromUser(); private static final char getHexChar(int); static final int getHexValue(char); public static final String intToAscii(int); public static final long intsToLong(int, int); public static final String javaPathToWinPath(String); public static final String pascalBytesToQPString(byte[]); public static final String pascalBytesToString(byte[], int); public static final Date rawDateToJDate(RawDate); public static final void stringToPascalBytes(String, byte[], int); }
Contains various utility routines.
Fields |
· copyrightString | Summary | Top |
private static final String copyrightString
· hexDigits | Summary | Top |
private static final char[] hexDigits
Constructors |
· JUtils | Summary | Top |
private JUtils()
Methods |
· fileToStringArray | Summary | Top |
public static String[] fileToStringArray(File fl)
Reads a text file, and returns an array containing each line of the file. Stops at the end of the file, or if a blank line is found.
· getFileNameFromUser | Summary | Top |
public static String getFileNameFromUser()
Display a FileDialog and return a full path name. Returns null if the user chooses 'Cancel'.
· rawDateToJDate | Summary | Top |
public static final Date rawDateToJDate(RawDate rd)
Convert a RawDate into a java.util.Date. If the year is less than 1901, it will be set to 1970. If rd is null, returns null.
· bytesToShort | Summary | Top |
public static final short bytesToShort(byte[] buf, int offset)
Convert two bytes of a byte array into a short. Big-endian.
Parameter Description offset the offset at which to start
· bytesToShortSwap | Summary | Top |
public static final short bytesToShortSwap(byte[] buf, int offs)
Convert two bytes of a byte array into a short. Little-endian.
Parameter Description offset the offset at which to start
· bytesToInt | Summary | Top |
public static final int bytesToInt(byte[] buf, int offset)
Convert four bytes of a byte array into an integer. Big-endian.
Parameter Description offset the offset at which to start
· bytesToIntSwap | Summary | Top |
public static final int bytesToIntSwap(byte[] buf, int offs)
Convert four bytes of a byte array into an integer. Little-endian.
Parameter Description offset the offset at which to start
· intsToLong | Summary | Top |
public static final long intsToLong(int hi, int lo)
· asciiToInt | Summary | Top |
public static final int asciiToInt(String s)
Converts an ASCII string into an integer. The string must contain exactly 4 characters, e.g, "TEXT".
· intToAscii | Summary | Top |
public static final String intToAscii(int n)
Convert an integer into a four character string. If any characters would be zero, they are replaced with spaces.
· stringToPascalBytes | Summary | Top |
public static final void stringToPascalBytes(String s, byte[] record, int offset)
Convert a java string into a Pascal string, and put it at the indicated position of a byte array.
· pascalBytesToString | Summary | Top |
public static final String pascalBytesToString(byte[] record, int offset)
Read a pascal-style string from a byte array.
· pascalBytesToQPString | Summary | Top |
public static final String pascalBytesToQPString(byte[] record)
Convert a Pascal string in a byte array into a quoted-printable String.
· javaPathToWinPath | Summary | Top |
public static final String javaPathToWinPath(String javaPath)
Convert a java-style file name into a Win-style file name.
· deQuoteDePrint | Summary | Top |
public static String deQuoteDePrint(String srcStr)
Convert a quoted-printable String into a regular String.
· getHexValue | Summary | Top |
static final int getHexValue(char cc)
· enQP | Summary | Top |
public static final String enQP(byte[] in)
· enQP | Summary | Top |
public static final String enQP(String in)
· getHexChar | Summary | Top |
private static final char getHexChar(int which)
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7