| java.lang.Object de.mcs.utils.codecs.Base64Encoder
Method Summary | |
public static void | encode(InputStream in, OutputStream out) Encodes data from supplied input to output. | public static void | encode(byte[] input, OutputStream out) Encodes from the supplied byte array and write the encoded data to the
OutputStream out . | public static String | encode(String input) Encode the given string and return the encoded version as a string.
Parameters: input - The string input to be encoded. | public static String | encode(byte[] bytes) Encode the given byte array and return the encoded version as a string.
Parameters: bytes - The byte array to be encoded. | public static void | main(String[] args) Run with one argument, prints the encoded version of it. |
encode | public static void encode(InputStream in, OutputStream out) throws IOException(Code) | | Encodes data from supplied input to output.
Parameters: in - The input stream to be encoded. Parameters: out - The output stream to write encoded data to. throws: IOException - if something goes wrong |
encode | public static void encode(byte[] input, OutputStream out) throws IOException(Code) | | Encodes from the supplied byte array and write the encoded data to the
OutputStream out .
Parameters: input - The byte array input to be encoded. Parameters: out - The output stream to write encoded data to. throws: IOException - if something goes wrong |
encode | public static String encode(String input) throws IOException(Code) | | Encode the given string and return the encoded version as a string.
Parameters: input - The string input to be encoded. It is assumed the string inputuses characters from the ISO 8859-1 code page. A String, representing the encoded content of the input String.The returned string uses charactes from 8859-1 code page. throws: IOException - if something goes wrong |
encode | public static String encode(byte[] bytes) throws IOException(Code) | | Encode the given byte array and return the encoded version as a string.
Parameters: bytes - The byte array to be encoded. A String, representing the encoded content of the input bytes.The returned string uses charactes from 8859-1 code page. throws: IOException - if something goes wrong |
main | public static void main(String[] args) throws Exception(Code) | | Run with one argument, prints the encoded version of it. With two, the
second is assumed to be the name of a MessageDigest to be applied to the
string before ENCODING (useful for generating password hashes).
Alternatively, use the openssl utility, for example:
echo -n "password" | openssl dgst -sha1 -binary | openssl base64
Parameters: args - String[] throws: Exception - if something goes wrong |
|
|