1 17 package org.apache.bcel.generic; 18 19 import java.io.DataOutputStream ; 20 import java.io.IOException ; 21 import org.apache.bcel.util.ByteSequence; 22 23 31 public class BIPUSH extends Instruction implements ConstantPushInstruction { 32 33 private byte b; 34 35 36 40 BIPUSH() { 41 } 42 43 44 46 public BIPUSH(byte b) { 47 super(org.apache.bcel.Constants.BIPUSH, (short) 2); 48 this.b = b; 49 } 50 51 52 55 public void dump( DataOutputStream out ) throws IOException { 56 super.dump(out); 57 out.writeByte(b); 58 } 59 60 61 64 public String toString( boolean verbose ) { 65 return super.toString(verbose) + " " + b; 66 } 67 68 69 72 protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException { 73 length = 2; 74 b = bytes.readByte(); 75 } 76 77 78 public Number getValue() { 79 return new Integer (b); 80 } 81 82 83 85 public Type getType( ConstantPoolGen cp ) { 86 return Type.BYTE; 87 } 88 89 90 98 public void accept( Visitor v ) { 99 v.visitPushInstruction(this); 100 v.visitStackProducer(this); 101 v.visitTypedInstruction(this); 102 v.visitConstantPushInstruction(this); 103 v.visitBIPUSH(this); 104 } 105 } 106 | Popular Tags |