Skip to content

A java library to read QQWry IP database. (纯真IP地址数据库)

License

Notifications You must be signed in to change notification settings

handanchen/qqwry-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qqwry-java

Build Status

usage:

Code sample:

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 myIP = "127.0.0.1";
IPZone ipzone = qqwry.findIP(myIP);
System.out.printf("%s, %s", ipzone.getMainInfo(), ipzone.getSubInfo());
// IANA, 保留地址用于本地回送

Gradle:

dependencies {
   compile(
     "com.github.jarod:qqwry-java:0.6.1",
   )
}

Maven:

<dependency>
  <groupId>com.github.jarod</groupId>
  <artifactId>qqwry-java</artifactId>
  <version>0.6.1</version>
</dependency>

build:

# OPTIONAL To embed qqwry.dat in the jar file, copy qqwry.dat to src/main/resources/qqwry.dat
# jar file will out put as ./build/lib/qqwry-java-X.X.X.jar
./gradlew jar

About

A java library to read QQWry IP database. (纯真IP地址数据库)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%