1 7 8 package org.gjt.jclasslib.bytecode; 9 10 import org.gjt.jclasslib.io.ByteCodeInput; 11 import org.gjt.jclasslib.io.ByteCodeOutput; 12 13 import java.io.IOException ; 14 15 21 public class ImmediateShortInstruction extends AbstractInstruction { 22 23 private int immediateShort; 24 25 public int getSize() { 26 return super.getSize() + 2; 27 } 28 29 33 public ImmediateShortInstruction(int opcode) { 34 super(opcode); 35 } 36 37 42 public ImmediateShortInstruction(int opcode, int immediateShort) { 43 super(opcode); 44 this.immediateShort = immediateShort; 45 } 46 47 51 public int getImmediateShort() { 52 return immediateShort; 53 } 54 55 59 public void setImmediateShort(int immediateShort) { 60 this.immediateShort = immediateShort; 61 } 62 63 public void read(ByteCodeInput in) throws IOException { 64 super.read(in); 65 66 immediateShort = in.readUnsignedShort(); 67 } 68 69 public void write(ByteCodeOutput out) throws IOException { 70 super.write(out); 71 72 out.writeShort(immediateShort); 73 } 74 75 } 76 | Popular Tags |