
org.robolectric.shadows.ShadowIoUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import libcore.io.IoUtils;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
@Implements(value = IoUtils.class, isInAndroidSdk = false)
public class ShadowIoUtils {
@Implementation
public static String readFileAsString(String absolutePath) throws IOException {
return new String(Files.readAllBytes(Paths.get(absolutePath)), UTF_8);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy