Returns the length of an address in a particular family. @param family The address family, either IPv4 or IPv6. @return The length of addresses in that family.
(int family)
| 381 | * @return The length of addresses in that family. |
| 382 | */ |
| 383 | public static int |
| 384 | addressLength(int family) { |
| 385 | if (family == IPv4) |
| 386 | return 4; |
| 387 | if (family == IPv6) |
| 388 | return 16; |
| 389 | throw new IllegalArgumentException("unknown address family"); |
| 390 | } |
| 391 | |
| 392 | /** |
| 393 | * Truncates an address to the specified number of bits. For example, |
no outgoing calls
no test coverage detected