Skip to content

Commit 899d6ec

Browse files
committed
Add README and CHANGELOG
1 parent 4d93a71 commit 899d6ec

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG
22
=========
33

4+
3.1.0
5+
------------------
6+
* Reader supports iterating over the whole database or within a network.
7+
48
3.0.0 (2022-12-12)
59
------------------
610

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,28 @@ public class Lookup {
120120
}
121121
```
122122

123+
You can also use the reader object to iterate over the database.
124+
The `reader.networks()` and `reader.networksWithin()` methods can
125+
be used for this purpose.
126+
127+
```java
128+
Reader reader = new Reader(file);
129+
Networks networks = reader.networks(false, Map.class);
130+
131+
while(networks.hasNext()) {
132+
DatabaseRecord<Map<String, String>> iteration = networks.next();
133+
134+
// Get the data.
135+
Map<String, String> data = iteration.getData();
136+
137+
// The IP Address
138+
InetAddress ipAddress = InetAddress.getByName(data.get("ip"));
139+
140+
// ...
141+
}
142+
```
143+
144+
123145
## Caching ##
124146

125147
The database API supports pluggable caching (by default, no caching is

0 commit comments

Comments
 (0)