diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a260192..94bc7410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ CHANGELOG ========= +3.1.0 +------------------ +* Reader supports iterating over the whole database or within a network. + 3.0.0 (2022-12-12) ------------------ diff --git a/README.md b/README.md index 507619ff..f1c98b17 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,28 @@ public class Lookup { } ``` +You can also use the reader object to iterate over the database. +The `reader.networks()` and `reader.networksWithin()` methods can +be used for this purpose. + +```java +Reader reader = new Reader(file); +Networks networks = reader.networks(false, Map.class); + +while(networks.hasNext()) { + DatabaseRecord> iteration = networks.next(); + + // Get the data. + Map data = iteration.getData(); + + // The IP Address + InetAddress ipAddress = InetAddress.getByName(data.get("ip")); + + // ... +} +``` + + ## Caching ## The database API supports pluggable caching (by default, no caching is