com.muchsoft.util
Class Mac

java.lang.Object
  extended bycom.muchsoft.util.Mac

public class Mac
extends java.lang.Object

This class offers Mac-specific (but portable) conversion routines. The "OSType" methods are useful when working with file metadata like type and creator codes.

Version History:

2004-10-13
First public release.

Version:
2004-10-13
Author:
Thomas Much

Method Summary
static java.lang.String fromOSType(int type)
          Converts an OS type from an int value to a 4-byte String.
static int toOSType(char a, char b, char c, char d)
          Converts four char values to an int value representing the OS type.
static int toOSType(java.lang.String s)
          Converts a 4-byte String to an int value representing the OS type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromOSType

public static java.lang.String fromOSType(int type)
Converts an OS type from an int value to a 4-byte String. If this method cannot use the "MacRoman" character encoding, it uses the system's default character encoding instead.

Parameters:
type - the OS type as an int value
Returns:
a 4-byte String
See Also:
quicktime.util.QTUtils.fromOSType

toOSType

public static int toOSType(java.lang.String s)
Converts a 4-byte String to an int value representing the OS type. If this method cannot use the "MacRoman" character encoding, it uses the system's default character encoding instead.

Parameters:
s - a 4-byte String
Returns:
an int containing the OS type
See Also:
quicktime.util.QTUtils.toOSType

toOSType

public static int toOSType(char a,
                           char b,
                           char c,
                           char d)
Converts four char values to an int value representing the OS type. If this method cannot use the "MacRoman" character encoding, it uses the system's default character encoding instead.

Parameters:
a - the char value containing the most significant byte
b - the char value containing the second most significant byte
c - the char value containing the least but one significant byte
d - the char value containing the least significant byte
Returns:
an int containing the OS type
See Also:
quicktime.util.QTUtils.toOSType