Skip to content

Support request for Java 8 Streams to get subsets of actual addresses within an IPv6Network #23

Description

@PredatorVI

I'm testing some applications in our service that do GeoIP queries using MaxMind GeoIP databases. The MaxMind data (CSV) is a list of CIDR formated subnets and for a given subnet I need to get a list/array of IPv6 Addresses to feed our service for testing. While I can use the iterator and manually limit the loop, supporting streams would be a nice feature.

Something like the following (my syntax may not be perfect...I'm learning lambdas and streams still):

IPv6Network network = IPv6Network.fromString("2c0f:f628::/32");
List<IPv6Address> = network.stream()
     .skip(1) //skip the network address
     .limit(1000)  //Give me 1000
     .collect(toList()); // as a list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions