You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Read-only primitive Java arrays backed by Direct Buffers and indexed using 64-bit indexes
3
+
4
+
The library uses a Builder Pattern for the array classes. When the builder is finalized, an appropriate implementation of the interface is choosen to fit the data. Here are some optimizations that is done upon build:
5
+
* Special implementation for empty arrays
6
+
* Small arrays are backed by an OnHeap array (regular `long[]`, `int[]`, etc)
7
+
* Medium sized arrays are backed by a single `DirectBuffer`
8
+
* Very large arrays (more than can be indexed with a 32-bit int) are backed by a number of direct buffers
9
+
* If all values fit a smaller primitive, they will be warped (`long` to `int`, `int` to `short` etc)
10
+
11
+
# Features
12
+
* 64-bit indexing
13
+
* Thread-safe (after build() has been called)
14
+
* Immutable using a Builder pattern
15
+
* Variable backing structure depending on the data
16
+
* Allocated buffers are cleared as soon as they are no longer used (no need to wait for GC)
0 commit comments