public class javacap { public native void open(String name, int bufferSize); public native void close(); public native void read(byte[] b); public native String getError(); public native int getDataLinkType(); public native int getPacketLength(); public native int getCapturedLength(); public native int setFilter(String rule, int netmask); public native int getReceivedPackets(); public native int getDroppedPackets(); static { System.loadLibrary("javacap"); } }