MCPcopy Create free account
hub / github.com/questdb/questdb / toNetMask

Method toNetMask

core/src/main/java/io/questdb/std/Numbers.java:2348–2356  ·  view source on GitHub ↗
(final int length)

Source from the content-addressed store, hash-verified

2346 }
2347
2348 public static int toNetMask(final int length) throws NumericException {
2349 if (length == 0) {
2350 return 0;
2351 }
2352 if (length < 0 || length > 32) {
2353 throw NumericException.instance().put("netmask length out of range [0-32]: ").put(length);
2354 }
2355 return (0xffffffff << (32 - length));
2356 }
2357
2358 private static void appendInt10(CharSink<?> sink, int i) {
2359 int c;

Callers 2

getIPv4NetmaskMethod · 0.95
parseSubnetMethod · 0.95

Calls 2

instanceMethod · 0.95
putMethod · 0.65

Tested by

no test coverage detected