(final QueryContext qc, final InputInfo ii)
| 14 | */ |
| 15 | public final class BinNot extends StandardFunc { |
| 16 | @Override |
| 17 | public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { |
| 18 | final Bin value = toBinOrNull(arg(0), qc); |
| 19 | if(value == null) return Empty.VALUE; |
| 20 | |
| 21 | final byte[] bytes = value.binary(info); |
| 22 | final int bl = bytes.length; |
| 23 | if(bl == 1) return B64.get((byte) ~bytes[0]); |
| 24 | |
| 25 | final byte[] tmp = new byte[bl]; |
| 26 | for(int b = 0; b < bl; b++) tmp[b] = (byte) ~bytes[b]; |
| 27 | return B64.get(tmp); |
| 28 | } |
| 29 | } |
nothing calls this directly
no test coverage detected