jnr.ffi.provider.jffi.NullPointerParameterStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jnr-ffi Show documentation
Show all versions of jnr-ffi Show documentation
A library for invoking native functions from java
package jnr.ffi.provider.jffi;
/**
*
*/
final class NullPointerParameterStrategy extends PointerParameterStrategy {
static final PointerParameterStrategy INSTANCE = new NullPointerParameterStrategy();
private NullPointerParameterStrategy() {
super(DIRECT);
}
@Override
public long address(Object o) {
return 0;
}
@Override
public Object object(Object o) {
throw new NullPointerException();
}
@Override
public int offset(Object o) {
throw new NullPointerException();
}
@Override
public int length(Object o) {
throw new NullPointerException();
}
}