added in API level 26

InMemoryDexClassLoader

public final class InMemoryDexClassLoader
extends BaseDexClassLoader

java.lang.Object
   ↳ java.lang.ClassLoader
     ↳ dalvik.system.BaseDexClassLoader
       ↳ dalvik.system.InMemoryDexClassLoader


A ClassLoader implementation that loads classes from a buffer containing a DEX file. This can be used to execute code that has not been written to the local file system.

Summary

Public constructors

InMemoryDexClassLoader(ByteBuffer[] dexBuffers, ClassLoader parent)

Create an in-memory DEX class loader with the given dex buffers.

InMemoryDexClassLoader(ByteBuffer dexBuffer, ClassLoader parent)

Creates a new in-memory DEX class loader.

Inherited methods

Public constructors

InMemoryDexClassLoader

added in API level 27
public InMemoryDexClassLoader (ByteBuffer[] dexBuffers, 
                ClassLoader parent)

Create an in-memory DEX class loader with the given dex buffers.

Parameters
dexBuffers ByteBuffer: array of buffers containing DEX files between buffer.position() and buffer.limit().

parent ClassLoader: the parent class loader for delegation.

InMemoryDexClassLoader

added in API level 26
public InMemoryDexClassLoader (ByteBuffer dexBuffer, 
                ClassLoader parent)

Creates a new in-memory DEX class loader.

Parameters
dexBuffer ByteBuffer: buffer containing DEX file contents between buffer.position() and buffer.limit().

parent ClassLoader: the parent class loader for delegation.