762763764765766767768769770771772
byte[] byteArray = b.getByteArray(); if (b != null && b.byteAt(0) == '/') { byte[] raw = byteArray; int end = raw.length - 1; for (int i = b.byteSize()-1; i > 0; i--) { if (b.byteAt(i*8) == '/') { end = i; break; } }
106107108109110111112113114115116
} @BIF public static ESmall external_size(EObject obj) { EBinary bin = term_to_binary(obj); return ERT.box(bin.byteSize()); } @BIF static ETuple2 split_binary(EObject bin, EObject idx) { EBitString b; ESmall i;
268269270271272273274275276277278
if ((bin = obj.testBinary()) == null) throw ERT.badarg(obj); // remove leading + int off = 0; if (bin.byteSize() > 0) { if (bin.byteAt(0) == '+') { off += 1; } }
294295296297298299300301302303304
if ((bin = obj.testBinary()) == null || (rdx = radix.testSmall()) == null) throw ERT.badarg(obj, radix); // remove leading + int off = 0; if (bin.byteSize() > 0) { if (bin.byteAt(0) == '+') { off += 1; } }
397398399400401402403404405406407
throw ERT.badarg(obj,start,stop); int idx0start = s.value-1; int len = e.value-s.value+1; if (idx0start < 0 || len < 0 || (idx0start + len) > bin.byteSize()) throw ERT.badarg(obj, start, stop); return EString.make(bin, idx0start, len); }
219220221222223224225226227228229
@BIF static ESmall iolist_size(EObject val) { EBinary bin; if ((bin=val.testBinary()) != null) { return new ESmall(bin.byteSize()); } EString str; if ((str=val.testString()) != null) { return new ESmall(str.length());
12501251125212531254125512561257125812591260
{ EBinary b; if ((b = o.testBinary()) == null) throw ERT.badarg(o); return ERT.box(b.byteSize()); } return ERT.box(t.arity()); } @BIF
12681269127012711272127312741275127612771278
if ((t = o.testTuple()) != null) return ERT.box(t.arity()); EBinary b; if ((b = o.testBinary()) != null) return ERT.box(b.byteSize()); return null; } @BIF(type = Type.GUARD, name = "size")
23152316231723182319232023212322232323242325
ESmall start1 = start.testSmall(); if (bin1 == null || start1 == null) { return null; } return binary_part_guard(bin, start, ERT.box( bin1.byteSize() - start1.value )); } @BIF(name="binary_part", type=Type.GUARD) public static EObject binary_part_guard(EObject bin, EObject start, EObject length) { EBinary bin1 = bin.testBinary();
23292330233123322333233423352336233723382339
if (bin1 == null || start1 == null || length == null) { return null; } if (start1.value < 0 || (start1.value + length1.value) > bin1.byteSize() || length1.value < 0) { return null; } return bin1.substring(start1.value * 8, length1.value * 8);