Package okhttp3.mock

Class RoboResources


  • public final class RoboResources
    extends java.lang.Object
    A helper class to provide responses from Roboelectric's sources
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.InputStream asset​(java.lang.String name)
      Loads the content from the given asset
      static java.io.InputStream rawRes​(int resource)
      Loads the content from the given raw resource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • asset

        public static java.io.InputStream asset​(java.lang.String name)
        Loads the content from the given asset
        Parameters:
        name - the name of the asset
        Returns:
        the content as an InputStream
      • rawRes

        public static java.io.InputStream rawRes​(@RawRes
                                                 int resource)
        Loads the content from the given raw resource
        Parameters:
        resource - the id of the resource
        Returns:
        the content as an InputStream