C wrapper library around fstlib for use with Java's Project Panama Foreign Function Interface (FFI).
This library (libfstbridge.so) exposes a flat C API that Java can call via Panama's MemorySegment / MethodHandle mechanism. Internally it uses fstlib's C++ FstStore to read .fst files — a fast, columnar binary format originating from the R ecosystem.
The bridge provides two main operations:
fst_read— read column data (all or selected columns, with optional row range)fst_meta— read only metadata (column names, types, row count)
- CMake ≥ 3.10
- A C++11 compatible compiler (GCC, Clang)
- OpenMP (optional, for parallel decompression)
- fstlib source tree at
../fstlib(sibling submodule)
mkdir -p build && cd build
cmake ..
makeThis produces libfstbridge.so in the build/ directory. The parent Scala/Kotlin/Java project expects the library to be on java.library.path at runtime.
This project uses fstlib, which is licensed under the Mozilla Public License 2.0 (MPL-2.0). The fstlib source code retains its original license.
fstlib additionally bundles:
- LZ4 (
fstlib/ext/lz4) — BSD 2-Clause license - Zstandard (
fstlib/ext/zstd) — BSD 3-Clause license