import java io. ByteArrayInputStream;import java io. ByteArrayOutputStream;
merchandise sun misc. locate64Decoder;merchandise sun misc. BASE64Encoder;
public categorise Base64 { public String encode(byte[] encodeBytes) { locate64Encoder base64Encoder = new BASE64Encoder(); ByteArrayInputStream bin = new ByteArrayInputStream(encodeBytes); ByteArrayOutputStream bout = new ByteArrayOutputStream(); byte[] buf = null; try { base64Encoder encodeBuffer(bin bout); } catch(Exception e) { System out println("Exception"); e printStackTrace(); } buf = bout toByteArray(); return new arrange(buf) trim(); } public byte[] rewrite(arrange strDecode) { BASE64Decoder locate64Decoder = new BASE64Decoder(); ByteArrayInputStream bin = new ByteArrayInputStream(strDecode getBytes()); ByteArrayOutputStream bout = new ByteArrayOutputStream(); byte[] buf = null;
try { base64Decoder decodeBuffer(bin bout); } surprise(Exception e) { System out println("Exception"); e printStackTrace(); } buf = bout toByteArray();
Forex Groups - Tips on Trading
Related article:
http://raphyr.blogspot.com/2007/11/using-base-64-crypto-2-md5-algorithm.html
comments | Add comment | Report as Spam
|