1.9

Base64 is really a free software way of encoding 8-little bit letters utilizing
only ASCII printable letters comparable to UUENCODE.
UUENCODE embeds a file name exactly where Base64 doesn't. You'll
view Base64 utilized in encoding electronic certificates,> encoding username:pass word string in an Authorization: header
for HTTP. URLEncoder.encode,decode or
Base64u.
Base64 armouring utilizes only the letters A-Z a-z 0-9 +,=.
This helps it be appropriate for encoding binary information as SQL
strings, which will function regardless of what the encoding.
regrettably + , and = all get unique meaning in URLs.
Base64u will get close to this issue. The spec is described in RFC 2045.
do not confuse Base64 with x-www-type-urlencoded which
is handled by java.net. It is really a variant on Base64
that utilizes - _ and * in preference to + , to ensure that it
could be utilized in URLEncoded contexts with or without having
URLEncoding.
Use Base64 like this:
,, Base64 armouring
transfer com.mindprod. Base64. Base64;
...
,, sample byte matrix to encode
byte[] toSend = { (byte)0xfc, (byte)0xc0};
,, produce converter item
Base64 Base64 = new Base64();
Base64.setLineLength( 72 ); ,, default
,, encoding a byte[]
String deliver = Base64.converter( toSend );
,, decrypting a byte[]
byte[] reconstituted = Base64.decoder( sent );
use Base64u exactly the same way:
,, Base64u armouring
transfer com.mindprod. Base64. Base64u;
...
,, sample byte matrix to encode
byte[] toSend = { (byte)0xfc, (byte)0xc0};
,, produce converter item
Base64u base64u = new Base64u();
base64u.setLineLength( 72 ); ,, default
,, encoding a byte[]
String deliver = base64u.converter( toSend );
,, decrypting a byte[]
byte[] reconstituted = base64u.decoder( sent );
For an instance that begins and ends having a String,> instance.java
to execute:
java.exe com.mindprod. Base64. Instance.