private MemoryFile getMemoryFile(String path) {
    try {
      byte[] data = ByteStreams.toByteArray(getTestImageInputStream(path));
      MemoryFile memoryFile = new MemoryFile(null, data.length);
      memoryFile.allowPurging(false);
      memoryFile.writeBytes(data, 0, 0, data.length);
      return memoryFile;
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }
This is the test in order to directly decoding all types of webp images
static-webp/src/androidTest/java/com/facebook/webpsupport/WebpDecodingTest.java