(final QueryContext qc, final InputInfo ii)
| 15 | */ |
| 16 | public final class BinPart extends BinFn { |
| 17 | @Override |
| 18 | public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { |
| 19 | final Bin value = toBinOrNull(arg(0), qc); |
| 20 | final long offset = toLong(arg(1), qc); |
| 21 | final Long size = toLongOrNull(arg(2), qc); |
| 22 | if(value == null) return Empty.VALUE; |
| 23 | |
| 24 | final byte[] bytes = value.binary(info); |
| 25 | final int[] bounds = bounds(offset, size, bytes.length); |
| 26 | |
| 27 | final int o = bounds[0], tl = bounds[1]; |
| 28 | return B64.get(Arrays.copyOfRange(bytes, o, o + tl)); |
| 29 | } |
| 30 | } |
nothing calls this directly
no test coverage detected