EAF 7.4 Implementation

com.lutris.util
Class Convert

java.lang.Object
  extended by com.lutris.util.Convert

Deprecated. Use HexEncoder or Base64Encoder.

public class Convert
extends java.lang.Object

Various conversion methods. These methods are mostly used to convert internal java data fields into byte arrays or strings for use over the network or in 8 bit ASCII fields.

See Also:
HexEncoder, Base64Encoder

Constructor Summary
Convert()
          Deprecated.  
 
Method Summary
static byte[] fromBase64String(java.lang.String s)
          Deprecated. Performs RFC1521 style Base64 decoding of Base64 encoded data.
static java.lang.String toBase64String(byte[] bytes)
          Deprecated. Performs RFC1521 style Base64 encoding of arbitrary binary data.
static java.lang.String toBase64String(byte[] bytes, char[] chars)
          Deprecated. Performs encoding of arbitrary binary data based on a 6 bit alphabet.
static java.lang.String toHexString(byte[] bytes)
          Deprecated. Converts an arbitrary array of bytes to ASCII hexadecimal string form, with two hex characters corresponding to each byte.
static java.lang.String toHexString(long value, int len, char pad)
          Deprecated. Converts a long integer to an unsigned hexadecimal String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Convert

public Convert()
Deprecated. 
Method Detail

toHexString

public static final java.lang.String toHexString(long value,
                                                 int len,
                                                 char pad)
Deprecated. 
Converts a long integer to an unsigned hexadecimal String. Treats the integer as an unsigned 64 bit value and left-pads with the pad character of the caller's choice.

Parameters:
value - The long integer to convert to a hexadecimal string.
len - The total padded length of the string. If the number is larger than the padded length, then this length of the string will be the length of the number.
pad - The character to use for padding.
Returns:
Unsigned hexadecimal numeric string representing the specified value.

toHexString

public static final java.lang.String toHexString(byte[] bytes)
Deprecated. 
Converts an arbitrary array of bytes to ASCII hexadecimal string form, with two hex characters corresponding to each byte. The length of the resultant string in characters will be twice the length of the specified array of bytes.

Parameters:
bytes - The array of bytes to convert to ASCII hex form.
Returns:
An ASCII hexadecimal numeric string representing the specified array of bytes.

toBase64String

public static final java.lang.String toBase64String(byte[] bytes)
Deprecated. 
Performs RFC1521 style Base64 encoding of arbitrary binary data. The output is a java String containing the Base64 characters representing the binary data. Be aware that this string is in Unicode form, and should be converted to UTF8 with the usual java conversion routines before it is sent over a network. The output string is guaranteed to only contain characters that are a single byte in UTF8 format. Also be aware that this routine leaves it to the caller to break the string into 70 byte lines as per RFC1521.

Parameters:
bytes - The array of bytes to convert to Base64 encoding.
Returns:
An string containing the specified bytes in Base64 encoded form.

toBase64String

public static final java.lang.String toBase64String(byte[] bytes,
                                                    char[] chars)
Deprecated. 
Performs encoding of arbitrary binary data based on a 6 bit alphabet. The output is a java String containing the encoded characters representing the binary data. Be aware that this string is in Unicode form, and should be converted to UTF8 with the usual java conversion routines before it is sent over a network. The alphabet passed in via chars is used without further checks, it's the callers responsibility to set it to something meaningful.

Parameters:
bytes - The array of bytes to convert to Base64 encoding.
chars - The alphabet used in encoding. Must contain exactly 65 characters: A 6 bit alphabet plus one padding char at position 65.
Returns:
An string containing the specified bytes in Base64 encoded form.

fromBase64String

public static final byte[] fromBase64String(java.lang.String s)
Deprecated. 
Performs RFC1521 style Base64 decoding of Base64 encoded data. The output is a byte array containing the decoded binary data. The input is expected to be a normal Unicode String object.

Parameters:
s - The Base64 encoded string to decode into binary data.
Returns:
An array of bytes containing the decoded data.

EAF 7.4 Implementation