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