Class cryptix.mime.LegacyString
All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.mime.LegacyString
java.lang.Object
|
+----cryptix.mime.LegacyString
- public class LegacyString
- extends Object
This class contains static functions useful in converting to between
Strings and byte arrays. The name of this class is to remind you that
there are better ways of performing such conversions these days -
Java 1.1 supplies its own byte-to-char converters, and the Reader and
Writer classes take care of most of the more finicky details in a much
better way than is done here. Nonetheless, this class exists in order
to maintain backwards compatibility with entities which were written
before the advent of Java and Unicode.
Note that class contains only static functions and has been declared
abstract since it will never need to be instantiated.
- Author:
- Jill Baker
-
LegacyString()
-
-
toByteArray(String)
- This conversion function is neccessary because Java 1.1+ uses
machine dependent char-to-byte and byte-to-char conversions.
-
toString(byte[])
- This conversion function is neccessary because Java 1.1+ uses
machine dependent char-to-byte and byte-to-char conversions.
LegacyString
public LegacyString()
toByteArray
public final static byte[] toByteArray(String s)
- This conversion function is neccessary because Java 1.1+ uses
machine dependent char-to-byte and byte-to-char conversions. This
is normally a useful feature, allowing machine independence.
In order to maintain backwards with pre-Java conventions, we
implement out own machine-independent deterministic converter.
- Parameters:
- s - string to be converted to bytes
- Returns:
- array of bytes containing lower 8 bits of each char
toString
public final static String toString(byte b[])
- This conversion function is neccessary because Java 1.1+ uses
machine dependent char-to-byte and byte-to-char conversions. This
is normally a useful feature, allowing machine independence.
In order to maintain backwards with pre-Java conventions, we
implement out own machine-independent deterministic converter.
- Parameters:
- b - array of bytes to be converted to a String
- Returns:
- String containing the bytes. Each char in the string
will be in the range to ÿ
All Packages Class Hierarchy This Package Previous Next Index