/** * Appends an 8bit value to the end of the bytecode sequence. */ public void add(int code) { super.add(code); }
/** * Appends the length-byte gap to the end of the bytecode sequence. * * @param length the gap length in byte. */ public void addGap(int length) { super.addGap(length); }
/** * Creates and returns a copy of this object. * The constant pool object is shared between this object * and the cloned object. */ public Object clone() { try { Bytecode bc = (Bytecode)super.clone(); bc.tryblocks = (ExceptionTable)tryblocks.clone(); return bc; } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse); } }
/** * Writes an 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ public void write(int offset, int value) { super.write(offset, value); }
/** * Reads a signed 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ public int read(int offset) { return super.read(offset); }
public final byte[] copy() { byte[] b = new byte[size]; arraycopy(buffer, b, size); return b; }
/** * Writes an 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ @Override public void write(int offset, int value) { super.write(offset, value); }
/** * Reads a signed 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ @Override public int read(int offset) { return super.read(offset); }
public void addGap(int length) { if (size + length > buffer.length) { int newSize = size << 1; if (newSize < size + length) newSize = size + length; byte[] newBuf = new byte[newSize]; arraycopy(buffer, newBuf, size); buffer = newBuf; } size += length; }
public void add(int b1, int b2) { addGap(2); buffer[size - 2] = (byte)b1; buffer[size - 1] = (byte)b2; }
/** * Appends an 8bit value to the end of the bytecode sequence. */ @Override public void add(int code) { super.add(code); }
/** * Writes an 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ public void write(int offset, int value) { super.write(offset, value); }
/** * Reads a signed 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ public int read(int offset) { return super.read(offset); }
/** * Creates and returns a copy of this object. * The constant pool object is shared between this object * and the cloned object. */ @Override public Object clone() { try { Bytecode bc = (Bytecode)super.clone(); bc.tryblocks = (ExceptionTable)tryblocks.clone(); return bc; } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse); } }
public void add(int b1, int b2, int b3, int b4) { addGap(4); buffer[size - 4] = (byte)b1; buffer[size - 3] = (byte)b2; buffer[size - 2] = (byte)b3; buffer[size - 1] = (byte)b4; }
/** * Appends an 8bit value to the end of the bytecode sequence. */ public void add(int code) { super.add(code); }
/** * Writes an 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ public void write(int offset, int value) { super.write(offset, value); }
/** * Reads a signed 8bit value at the offset from the beginning of the * bytecode sequence. * * @throws ArrayIndexOutOfBoundsException if offset is invalid. */ public int read(int offset) { return super.read(offset); }
/** * Creates and returns a copy of this object. * The constant pool object is shared between this object * and the cloned object. */ public Object clone() { try { Bytecode bc = (Bytecode)super.clone(); bc.tryblocks = (ExceptionTable)tryblocks.clone(); return bc; } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse); } }
public void add(int code) { addGap(1); buffer[size - 1] = (byte)code; }