You don't in pure Java. The solution would be to write some native code (possibly in C or C++), then call that using JNI or JNA.