List of usage examples for android.util Base64 NO_WRAP
int NO_WRAP
To view the source code for android.util Base64 NO_WRAP.
Click Source Link
From source file:Main.java
public static String decodeBase64(String encodedString) { byte[] byteData = Base64.decode(encodedString, Base64.NO_WRAP); String decodedString = null;/* w ww .ja v a2 s . c om*/ try { decodedString = new String(byteData, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return decodedString; }
From source file:Main.java
public static String decodeToString(String encodedString) { try {/*from ww w. j ava 2 s . com*/ return new String(Base64.decode(encodedString, Base64.NO_WRAP)); } catch (Exception e) { e.printStackTrace(); } return ""; }
From source file:Main.java
public static String getBasicHeader(String name, String password) { String str = Base64.encodeToString((name + ":" + password).getBytes(), Base64.NO_WRAP); return "Basic " + str; }
From source file:Main.java
public static String getBase64String(String value) throws UnsupportedEncodingException { return Base64.encodeToString(value.getBytes("UTF-8"), Base64.NO_WRAP); }
From source file:Main.java
public static String base64Decode(String s) { byte[] dataDec = Base64.decode(s, Base64.NO_WRAP); String decodedString = ""; try {/*from w w w . ja v a2 s. c om*/ decodedString = new String(dataDec, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } finally { return decodedString; } }
From source file:Main.java
public static String getB64Auth(String login, String pass) { String source = login + ":" + pass; String ret = "Basic " + Base64.encodeToString(source.getBytes(), Base64.URL_SAFE | Base64.NO_WRAP); return ret;/*from w w w . ja v a 2 s. c o m*/ }
From source file:Main.java
public static byte[] base64Encode(byte[] input) { return Base64.encode(input, Base64.NO_WRAP); }
From source file:Main.java
public static byte[] base64Decode(byte[] input) { return Base64.decode(input, Base64.NO_WRAP); }
From source file:Main.java
public static String encode(String str, int time) { String result = new String(str); for (int i = 0; i < time; i++) { result = new String(Base64.encode(result.getBytes(), Base64.NO_WRAP)); }//from www . j a v a 2s.c om return result; }
From source file:Main.java
public static String generateToken(String username, String password) { String credentials = username + ":" + password; String base64EncodedCredentials = Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP); return "Basic " + base64EncodedCredentials; }