1 7 8 package org.gjt.jclasslib.structures.constants; 9 10 import org.gjt.jclasslib.structures.InvalidByteCodeException; 11 12 import java.io.*; 13 14 20 public class ConstantLongInfo extends ConstantLargeNumeric { 21 22 public byte getTag() { 23 return CONSTANT_LONG; 24 } 25 26 public String getTagVerbose() { 27 return CONSTANT_LONG_VERBOSE; 28 } 29 30 public String getVerbose() throws InvalidByteCodeException { 31 return String.valueOf(getLong()); 32 } 33 34 38 public long getLong() { 39 return (long)highBytes << 32 | ((long)lowBytes & 0x7FFFFFFF); 40 } 41 42 46 public void setLong(long number) { 47 highBytes = (int)(number >>> 32); 48 lowBytes = (int)(number & 0x0000FFFF); 49 } 50 51 public void read(DataInput in) 52 throws InvalidByteCodeException, IOException { 53 54 super.read(in); 55 if (debug) debug("read "); 56 } 57 58 public void write(DataOutput out) 59 throws InvalidByteCodeException, IOException { 60 61 out.writeByte(CONSTANT_LONG); 62 super.write(out); 63 if (debug) debug("wrote "); 64 } 65 66 protected void debug(String message) { 67 super.debug(message + getTagVerbose() + " with high_bytes " + highBytes + 68 " and low_bytes " + lowBytes); 69 } 70 71 } 72 | Popular Tags |