Added in API level 26

InMemoryDexClassLoader

class InMemoryDexClassLoader : BaseDexClassLoader
kotlin.Any
   ↳ 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(dexBuffers: Array<ByteBuffer!>, librarySearchPath: String?, parent: ClassLoader?)

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

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

Creates a new in-memory DEX class loader.

Inherited functions

Public constructors

InMemoryDexClassLoader

Added in API level 29
InMemoryDexClassLoader(
    dexBuffers: Array<ByteBuffer!>,
    librarySearchPath: String?,
    parent: ClassLoader?)

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

Parameters
dexBuffers Array<ByteBuffer!>: array of buffers containing DEX files between buffer.position() and buffer.limit(). This value cannot be null.
librarySearchPath String?: the list of directories containing native libraries, delimited by File.pathSeparator; may be null
parent ClassLoader?: the parent class loader for delegation. This value may be null.

InMemoryDexClassLoader

Added in API level 27
InMemoryDexClassLoader(
    dexBuffers: Array<ByteBuffer!>,
    parent: ClassLoader?)

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

Parameters
dexBuffers Array<ByteBuffer!>: array of buffers containing DEX files between buffer.position() and buffer.limit(). This value cannot be null.
parent ClassLoader?: the parent class loader for delegation. This value may be null.

InMemoryDexClassLoader

Added in API level 26
InMemoryDexClassLoader(
    dexBuffer: ByteBuffer,
    parent: ClassLoader?)

Creates a new in-memory DEX class loader.

Parameters
dexBuffer ByteBuffer: buffer containing DEX file contents between buffer.position() and buffer.limit(). This value cannot be null.
parent ClassLoader?: the parent class loader for delegation. This value may be null.