public class AIMUtil extends Object
Constructor and Description |
---|
AIMUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
about()
Print about information.
|
static byte[] |
byteArrayFromHexString(String s)
Turn a hex string into the corresponding byte array.
|
static String |
byteArrayToHexString(byte[] b)
Turn a byte array into the corresponding string.
|
static String |
charsetAOLToJava(int charset)
Given a short value indicating the charset code, return the corresponding
Java string indicating the charset.
|
static String |
charsetAOLToJava(String charset)
Given a string indicating the charset, return the corresponding
Java string indicating the charset.
|
static String |
convertHTMLToOSCAR(String str)
Convert from HTML to OSCAR markup
|
static String |
convertOSCARToHTML(String str)
Convert from OSCAR markup to HTML
|
static String |
dirAOLToSys(String name)
Convert an AOL style directory name to system.
|
static String |
dirSysToAOL(String name)
Convert a system style directory name to AOL.
|
static String |
extractRoomName(String s)
Extract the name from a Chat name.
|
static String |
flapChannelToString(int channel)
Print the plain-text description of a FLAP channel.
|
static String |
getLibraryDate()
Get the library date.
|
static String |
getLibraryVersion()
Get the library version.
|
static String |
hexdump(byte[] data)
Returns a string representing a hex dump of the given byte array.
|
static String |
memInfo()
Print Java runtime memory information before and after garbage
collection.
|
static String |
normalize(String sn)
Normalizes a screenname (removes spaces and lowercases all letters).
|
static String |
parseProfileEncoding(String enc)
Parse a profile encoding string.
|
static String |
prettyPrintTime(long time)
Convert the time elapsed in milliseconds to a pretty string.
|
static String |
snacErrorToString(int error)
Return the plain-text description of a SNAC error.
|
static String |
snacToString(int family,
int subtype)
Return the plain-text description of a SNAC given a family and subtype.
|
static boolean |
snCmp(String sn1,
String sn2)
Checks two given screennames for equality.
|
static int |
snLen(String sn)
Return the length of the given screenname (ignoring spaces).
|
static byte[] |
uuidToByteArray(String uuid)
This lets us turn a UUID (Universally Uninque Identifier) string into a
byte array.
|
public static String getLibraryVersion()
public static String getLibraryDate()
public static int snLen(String sn)
sn
- the screennamepublic static String normalize(String sn)
sn
- the non-normalized screennamepublic static boolean snCmp(String sn1, String sn2)
sn1
- the first screennamesn2
- the second screennamepublic static byte[] byteArrayFromHexString(String s)
s
- the hex string to convertpublic static String byteArrayToHexString(byte[] b)
b
- the byte array to convertpublic static byte[] uuidToByteArray(String uuid)
uuid
- the UUID stringpublic static String about()
public static String memInfo()
public static String flapChannelToString(int channel)
channel
- the FLAP channelString
valuepublic static String snacToString(int family, int subtype)
family
- the SNAC familysubtype
- the SNAC subtypepublic static String snacErrorToString(int error)
error
- the error codepublic static String extractRoomName(String s)
s
- the Chat namepublic static String dirAOLToSys(String name)
name
- the filenamepublic static String dirSysToAOL(String name)
name
- the filenamepublic static String prettyPrintTime(long time)
time
- the time elapsed in millisecondspublic static String hexdump(byte[] data)
data
- the byte array of the data you want to hex dumppublic static String convertHTMLToOSCAR(String str)
str
- the string to convertpublic static String convertOSCARToHTML(String str)
str
- the string to convertpublic static String parseProfileEncoding(String enc)
enc
- the profile encodingpublic static String charsetAOLToJava(int charset) throws UnsupportedEncodingException
charset
- the short value indicating the charsetUnsupportedEncodingException
- if an error occurspublic static String charsetAOLToJava(String charset) throws UnsupportedEncodingException
charset
- the string indicating the charsetUnsupportedEncodingException
- if an error occurs