GithubHelp home page GithubHelp logo

java's People

Contributors

ilsanbao avatar ipipdotnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java's Issues

序列化问题

在spark中使用,在执行端会报序列化的问题?

something wrong with your code.

Exception in thread "main" java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Unknown Source)
at java.nio.HeapByteBuffer.getInt(Unknown Source)
at org.casper.iptest.IPExt.find(IPExt.java:66)
at org.casper.iptest.IPExt.main(IPExt.java:18)

报个bug

index_length = (0xFF & indexBuffer.get(start + 7) << 8) + (0xFF & indexBuffer.get(start + 8));

以下代码前面一半少了一个括号:
(0xFF & indexBuffer.get(start + 7) << 8) + (0xFF & indexBuffer.get(start + 8));
<<的优先级高于&,导致前面这部分算出来总是0,正确的应该是:
((0xFF & indexBuffer.get(start + 7)) << 8) + (0xFF & indexBuffer.get(start + 8));

报错,怎么解决?

Exception in thread "main" java.nio.BufferUnderflowException
at java.base/java.nio.HeapByteBuffer.get(HeapByteBuffer.java:191)
at com.ip.IPExt.load(IPExt.java:107)
at com.ip.IPExt.load(IPExt.java:34)
at com.ip.IPExt.main(IPExt.java:15)

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)

疑似可能出现乱码的Bug?

find的返回函数应改为

return new String(areaBytes, Charset.forName("UTF-8")).split("\t");

以避免在非utf8编码平台上打印时的乱码。

IPExt类怎么解析开始ip

for (start = start * 9 + 262144; start < max_comp_len; start += 9) {
tmpInt = int2long(indexBuffer.getInt(start));
if (tmpInt >= ip2long_value) {
index_offset = bytesToLong(b, indexBuffer.get(start + 6), indexBuffer.get(start + 5), indexBuffer.get(start + 4));
index_length = ((0xFF & indexBuffer.get(start + 7)) << 8) + (0xFF & indexBuffer.get(start + 8));
break;
}
}

这段代码tmpInt 解析出来在是终止ip,请问起始ip要怎么解析

ip data not found

用IPCounty解析区县版datx格式地址库报错,ip data not found

why use lock instead of RWLock

in IP.java:
why "import java.util.concurrent.locks.ReentrantLock" ,
why not "java.util.concurrent.locks.ReentrantReadWriteLock"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.