java icon indicating copy to clipboard operation
java copied to clipboard

IndexOutOfBoundsException in IPExt test

Open yiming187 opened this issue 9 years ago • 4 comments

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)

yiming187 avatar Jul 29 '15 15:07 yiming187

me too ...

Yi-Lyu avatar Nov 17 '15 04:11 Yi-Lyu

IPExt 只支持datx格式的文件不支持dat格式

17mon avatar Jan 07 '16 05:01 17mon

@17mon 就是下载的datx文件, 也报错.

childe avatar Feb 25 '16 09:02 childe

me too ...

sagomilk avatar Feb 27 '17 02:02 sagomilk