public class QQWry extends Object
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, 保留地址用于本地回送
public QQWry()
throws IOException
IOException - if encounter error while reading qqwry.datpublic QQWry(byte[] data)
data - fully read data from a qqwry.dat file.public QQWry(Path file, byte[] data) throws IOException
file - path to qqwry.datdata - IOException - if encounter error while reading from the given file.Copyright © 2021. All rights reserved.