Base64 Encoder/Decoder
Before proceeding to read download the source code please note
that all the information required to write the encoder
can be found on the about.com website. When writing
this application I researched about how Base64 encoding
works and read up a bit on bit shifting, a technique
used in C/C++ and Java programming. I have provided
the URLs to Base64 information below:
About.com - Used for research on how Base64 works.
Base64 Encoder and Decoder (makcoder) - Used to test my app results.
Description & Usage Information
This application is a fully functional Base64 Encoder
/Decoder. Blocks of code are commented as they were
earlier versions/methods used for the application and
may no longer work. The methods used in this application
were written and coded purely by it's author and no
code was taken from any other variants of its kind.
Download the source code now.
I do realize some methods used in the code may
not be the most efficient, but the application was
written for learning purposes and no guarantees are
bound by this source code except learning a thing or two.
Using the application is simple. Since this is a
command-line application you must run cmd.exe and
go to the directory of this file and type the following
command: java Base64 -arg[0] -arg[1] "arg[2]" "optional arg[3]"
| Arg # | Argument | Description |
| args[0] |
-encode -decode |
Encode Base64 Decode Base64 |
| args[1] |
-f -s |
Encoding/Decoding file Encoding/Decoding string |
| args[2] |
"source_path_here" "source_string_here" |
Path of source data Source Data String |
| args[3] | "output_path_here" | Define output location. If undefined, outputs to path of file ".base64" unless -s argument is used then it will be directly outputted to console. |
Example of use (encode file):
java Base64 -encode -f "C:\family_photo.jpg" "C:\family_photo.base64"
Example of use (decode file):
java Base64 -decode -f "C:\family_photo.base64" "C:\family_photo.jpg"
Example of use (encode string, output console):
java Base64 -encode -s "Hello"
Example of use (decode string, output file):
java Base64 -decode -s "SGVsbG8="


beeen a while