程序包 online.xcodes.ip
类 QQWry
java.lang.Object
online.xcodes.ip.QQWry
Thread safe. A QQWry instance can share amount threads.
Usage:
QQWry qqwry = new QQWry(); // load qqwry.dat from classpath
QQWry qqwry = new QQWry(Paths.get("path/to/qqwry.dat")); // load qqwry.dat from java.nio.file.Path
byte[] data = Files.readAllBytes(Paths.get("path/to/qqwry.dat"));
QQWry qqwry = new QQWry(data); // create QQWry with provided data
String dbVer = qqwry.getDatabaseVersion();
System.out.printf("qqwry.dat version=%s", dbVer);
// qqwry.dat version=2020.9.10
String myIP = "127.0.0.1";
IPZone ipzone = qqwry.findIP(myIP);
System.out.printf("%s, %s", ipzone.getMainInfo(), ipzone.getSubInfo());
// IANA, 保留地址用于本地回送
- 作者:
- Jarod Liu <liuyuanzhi@gmail.com>
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明online.xcodes.ip.QQWry.IPZoneqqwry database version in pattern x.x.x
-
构造器详细资料
-
QQWry
Create QQWry by loading qqwry.dat from classpath.- 抛出:
IOException- if encounter error while reading qqwry.dat
-
QQWry
public QQWry(byte[] data) Create QQWry with provided qqwry.dat data.- 参数:
data- fully read data from a qqwry.dat file.
-
QQWry
Create QQWry from a path to qqwry.dat file.- 参数:
file- path to qqwry.dat- 抛出:
IOException- if encounter error while reading from the given file.
-
-
方法详细资料
-
findIP
-
getDatabaseVersion
qqwry database version in pattern x.x.x
-