MCPcopy Index your code
hub / github.com/questdb/questdb / checkedLoHiSize

Method checkedLoHiSize

core/src/main/java/io/questdb/std/bytes/Bytes.java:49–60  ·  view source on GitHub ↗

Compute the size of a range, checking for overflow.

(long lo, long hi, int baseSize)

Source from the content-addressed store, hash-verified

47 * Compute the size of a range, checking for overflow.
48 */
49 public static int checkedLoHiSize(long lo, long hi, int baseSize) {
50 final long additional = hi - lo;
51 if (additional < 0) {
52 throw new IllegalArgumentException("lo > hi");
53 }
54 final long size = baseSize + additional;
55
56 if (size > (long) Integer.MAX_VALUE) {
57 throw new IllegalArgumentException("size exceeds 2GiB limit");
58 }
59 return (int) additional;
60 }
61}

Callers 4

putNonAsciiMethod · 0.95
putNonAsciiMethod · 0.95
putNonAsciiMethod · 0.95
putNonAsciiMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected