java
java copied to clipboard
IndexOutOfBoundsException in IPExt test
I just downloaded the source code and data file. The IP.java runs very well, but the IPExt.java met some errors. Do you have any idea?
public static void main(String[] args) {
IPExt.load("data/17monipdb.dat");
System.out.println(Arrays.toString(IPExt.find("8.8.8.8")));
System.out.println(Arrays.toString(IPExt.find("118.28.8.8")));
System.out.println(Arrays.toString(IPExt.find("255.255.255.255")));
}
Exception in thread "main" java.lang.IndexOutOfBoundsException at java.nio.Buffer.checkIndex(Buffer.java:546) at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:365) at com.yiming187.jnetpcap_example.ip.IPExt.find(IPExt.java:66) at com.yiming187.jnetpcap_example.ip.IPExt.main(IPExt.java:18)
me too ...
IPExt 只支持datx格式的文件不支持dat格式
@17mon 就是下载的datx文件, 也报错.
me too ...