java.lang.Object
|
+--stec.net.Codecs
public class Codecs
Methods for encoding/decoding text.
Methods
Method
|
Description
|
base64Decode
|
Decodes the specified Base64 encoded string or byte array.
|
base64Encode
|
Used to Base64 encoded the given string or byte array.
|
UUDecode
|
Decodes the specified UUEncoded string or byte array.
|
UUEncode
|
Used to UUEncode the given string or byte array.
|
base64Decode
Decodes the specified Base64 encoded string or byte array.
Syntax
public final static String base64Decode(String string)
public final static byte[] base64Decode(byte[] bytearray)
Parameters
string
|
the Base64 encoded string to decode.
|
bytearray
|
the Base64 encoded array of bytes to decode.
|
Returns
String
|
the decoded string.
|
byte[]
|
the decoded array of bytes.
|
Throws
Example
String message = Codecs.base64Decode(encodedMessage);
base64Encode
Used to Base64 encoded the given string or byte array.
Syntax
public final static String base64Encode(String string)
public final static byte[] base64Encode(byte[] bytearray)
Parameters
string
|
the string to encode.
|
bytearray
|
the array of bytes to encode.
|
Returns
String
|
the encoded string.
|
byte[]
|
the encoded array of bytes.
|
Throws
Example
String encodedMessage = Codecs.base64Encode(message);
UUDecode
Decodes the specified UUEncoded string or byte array.
Syntax
public final static String UUDecode(String string)
public final static byte[] UUDecode(byte[] bytearray)
Parameters
string
|
the UUEncoded string to decode.
|
bytearray
|
the UUEncoded array of bytes to decode.
|
Returns
String
|
the decoded string.
|
byte[]
|
the decoded array of bytes.
|
Throws
Example
String message = Codecs.UUDecode(encodedMessage);
UUEncode
Used to UUEncode the given string or byte array.
Syntax
public final static String UUEncode(String string)
public final static byte[] UUEncode(byte[] bytearray)
Parameters
string
|
the string to encode.
|
bytearray
|
the array of bytes to encode.
|
Returns
String
|
the encoded string.
|
byte[]
|
the encoded array of bytes.
|
Throws
Example
String encodedMessage = Codecs.UUEncode(message);
|