Google is committed to advancing racial equity for Black communities. See how.
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
<init>(dexBuffers: Array<ByteBuffer!>, librarySearchPath: String?, parent: ClassLoader?)

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

<init>(dexBuffers: Array<ByteBuffer!>, parent: ClassLoader?)

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

<init>(dexBuffer: ByteBuffer, parent: ClassLoader?)

Creates a new in-memory DEX class loader.

Inherited functions

Public constructors

<init>

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().
librarySearchPath String?: the list of directories containing native libraries, delimited by File.pathSeparator; may be null
parent ClassLoader?: the parent class loader for delegation.

<init>

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().
parent ClassLoader?: the parent class loader for delegation.

<init>

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().
parent ClassLoader?: the parent class loader for delegation.