Package 

Interface MapBuffer

  • All Implemented Interfaces:
    kotlin.collections.Iterable

    
    public interface MapBuffer
     implements Iterable<MapBuffer.Entry>
                        

    MapBuffer is an optimized sparse array format for transferring props-like data between C++ and JNI. It is designed to:

    • be compact to optimize space when sparse (sparse is the common case).

    • be accessible through JNI with zero/minimal copying.

    • work recursively for nested maps/arrays.

    • support dynamic types that map to JSON.

    • have minimal APK size and build time impact.

    See <react/renderer/mapbuffer/MapBuffer.h> for more information and native implementation.

    Limitations:

    • Keys are usually sized as 2 bytes, with each buffer supporting up to 65536 entries as a result.

    • O(log(N)) random key access for native buffers due to selected structure. Faster access can be achieved by retrieving MapBuffer.Entry with entryAt on known offsets.