-
Notifications
You must be signed in to change notification settings - Fork 64
Code Examples
Sean C Foley edited this page Dec 28, 2020
·
157 revisions
Creating, Parsing, Checking Host/Address/Subnet, Extracting Address/Subnet Info
- Parse IP Address or Subnet String
- Parse IP Address String with Prefix Length as Subnet or IP Address
- Check if String is an IP Address or Host Name
- Parse Socket Address
- Convert to/from byte[], int, BigInteger or InetAddress
- Get Prefix Length, Network Mask, Network Address, Version, Subnet Size and Segments from CIDR Address or Subnet
- Check if Multicast
- Control Parsing of IP Addresses with Fewer Segments than Standard
Subnet or Range Containment Checks
- Check if Subnet Contains Address or Subnet
- Check if Address or Subnet Falls within Arbitrary Address Range
- Select CIDR Prefix Block Subnets Containing an Address
- Select Addresses Contained by a CIDR Prefix Block Subnet
- Get Prefix Blocks Common to List of Addresses
- Longest Prefix Match
- Select Addresses and Subnets within Arbitrary Address Range
Subnetting and Other Subnet Operations
- Iterate through Subnet
- Iterate through Subnet Boundaries
- Sequential or Parallel Operations on Subnets using Streams
- From Start and End Address, Get a Minimal List of CIDR Blocks Spanning the Range
- From Start and End Address, Get a Single CIDR Block Covering Both
- Merge a List of Addresses or Subnets into a Minimal List of CIDR Blocks
- Break a CIDR Prefix Block into Direct Component Blocks
- Iteratively Break a CIDR Prefix Block into Component Blocks
- Derive New Subnet from Existing CIDR Subnet
- Remove Address or Subnet from Subnet
Converting to/from Other Formats
- Produce a Variety of Strings of an Address for Text Search
- Convert to Binary String
- Convert to/from IPv6 Address from/to MAC Address
- Convert to/from IPv6 Address from/to Ascii Base 85 Encoding
- Convert Subnet Members to Integers using Filter, Map and Collect Stream Operations
- Extend Address Classes for Customized Conversion to/from IPv4 Address from/to IPv6 Address
- Write/Read Addresses to/from Direct Byte Buffer in Native Byte Order