1 package com.xtremelabs.robolectric.shadows; 2 3 import com.xtremelabs.robolectric.internal.Implementation; 4 import com.xtremelabs.robolectric.internal.Implements; 5 6 import org.apache.commons.codec.binary.Base64; 7 8 @Implements(android.util.Base64.class) 9 public class ShadowBase64 { 10 11 @Implementation encodeToString(byte[] bytes, int flags)12 public static String encodeToString(byte[] bytes, int flags) { 13 Base64 base64 = new Base64(); 14 return base64.encodeBase64String(bytes); 15 } 16 17 @Implementation decode(String str, int flags)18 public static byte[] decode(String str, int flags) { 19 Base64 base64 = new Base64(); 20 return base64.decodeBase64(str); 21 } 22 } 23