protected internal virtual Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { Attribute attr = new Attribute(type); attr.value = new byte[len]; SystemJ.arraycopy(cr.b, off, attr.value, 0, len); return(attr); }
private void enlarge(int size) { int length1 = 2 * data.Length; int length2 = length + size; byte[] newData = new byte[length1 > length2 ? length1 : length2]; SystemJ.arraycopy(data, 0, newData, 0, length); data = newData; }
public virtual ByteVector putByteArray(byte[] b, int off, int len) { if (length + len > data.Length) { enlarge(len); } if (b != null) { SystemJ.arraycopy(b, off, data, length, len); } length += len; return(this); }
private void addReference(int sourcePosition, int referencePosition) { if (srcAndRefPositions == null) { srcAndRefPositions = new int[6]; } if (referenceCount >= srcAndRefPositions.Length) { int[] a = new int[srcAndRefPositions.Length + 6]; SystemJ.arraycopy(srcAndRefPositions, 0, a, 0, srcAndRefPositions.Length); srcAndRefPositions = a; } srcAndRefPositions[referenceCount++] = sourcePosition; srcAndRefPositions[referenceCount++] = referencePosition; }
private void init(int var) { if (initializations == null) { initializations = new int[2]; } int n = initializations.Length; if (initializationCount >= n) { int[] t = new int[Math.Max(initializationCount + 1, 2 * n)]; SystemJ.arraycopy(initializations, 0, t, 0, n); initializations = t; } initializations[initializationCount++] = var; }
private void set(int local, int type) { if (outputLocals == null) { outputLocals = new int[10]; } int n = outputLocals.Length; if (local >= n) { int[] t = new int[Math.Max(local + 1, 2 * n)]; SystemJ.arraycopy(outputLocals, 0, t, 0, n); outputLocals = t; } outputLocals[local] = type; }
private Item addType(Item item) { ++typeCount; Item result = new Item(typeCount, key); put(result); if (typeTable == null) { typeTable = new Item[16]; } if (typeCount == typeTable.Length) { Item[] newTable = new Item[2 * typeTable.Length]; SystemJ.arraycopy(typeTable, 0, newTable, 0, typeTable.Length); typeTable = newTable; } typeTable[typeCount] = result; return(result); }
private void push(int type) { if (outputStack == null) { outputStack = new int[10]; } int n = outputStack.Length; if (outputStackTop >= n) { int[] t = new int[Math.Max(outputStackTop + 1, 2 * n)]; SystemJ.arraycopy(outputStack, 0, t, 0, n); outputStack = t; } outputStack[outputStackTop++] = type; int top = owner.inputStackTop + outputStackTop; if (top > owner.outputStackMax) { owner.outputStackMax = top; } }