Skip to content

Instantly share code, notes, and snippets.

View shalupov's full-sized avatar

Leonid Shalupov shalupov

View GitHub Profile
@shalupov
shalupov / gist:31c53bbdff73a412662507ef19383973
Last active May 7, 2022 15:45
jna: typed "reference placeholders"
package com.sun.jna.platform.mac;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;
import java.util.function.Function;
class ByReference<T extends CoreFoundation.CFTypeRef> extends PointerByReference {
private final Function<Pointer, T> typedValueFactory;