Here you can find the source of base64()
public static String base64()
//package com.java2s; //License from project: Open Source License public class Main { public static String base64() { String systemName = systemName(); String ret;// ww w . ja v a 2 s . c o m if ("Linux".equals(systemName)) { ret = "base64 -w"; } else if ("Mac OS X".equals(systemName)) { ret = "base64 -b"; } else { throw new RuntimeException(String.format("%s is not a supported platform.", systemName)); } return ret; } public static String systemName() { return System.getProperty("os.name"); } }