These two functions are not exactly critical but may be useful to some developers.
is_allocated() tells us whether a backing buffer is created in RAM, or if the data is directly mmap()'ed from the APK (e.g. because no decompression was needed and alignment requirements are upheld). Note that it only returns true after the asset is "mapped" (or read in some way) via e.g get_buffer(); solely opening the asset is not enough to trigger the allocation and decompression.
open_file_descriptor() gives the user a file descriptor, which simply seems to be a dup() of that from the opened APK, together with an offset and size of the given AAsset within that APK. It also requires the asset to be stored uncompressed within the APK.
These two functions are not exactly critical but may be useful to some developers.
is_allocated()
tells us whether a backing buffer is created in RAM, or if the data is directlymmap()
'ed from the APK (e.g. because no decompression was needed and alignment requirements are upheld). Note that it only returnstrue
after the asset is "mapped" (or read in some way) via e.gget_buffer()
; solely opening the asset is not enough to trigger the allocation and decompression.open_file_descriptor()
gives the user a file descriptor, which simply seems to be adup()
of that from the opened APK, together with an offset and size of the givenAAsset
within that APK. It also requires the asset to be stored uncompressed within the APK.