📄 constantfloatinfo.java
字号:
/**
*
*/
package gen.info.constant;
import gen.ClassFile;
import java.io.DataOutputStream;
import java.io.IOException;
/**
* @author liuyi
*
*/
public class ConstantFloatInfo extends CpInfo {
private int bytes;
/**
* @param tag
*/
public ConstantFloatInfo(int bytes, ClassFile classFile) {
super(CONSTANT_Float, classFile);
this.bytes = bytes;
}
public ConstantFloatInfo(float value, ClassFile classFile){
this(Float.floatToIntBits(value), classFile);
}
public int getBytes(){
return bytes;
}
public String getRefString(){
return "float\t" + String.valueOf(Float.intBitsToFloat(bytes));
}
public String toString(){
return "const #" + index + " = " + getRefString();
}
public void toBinary(DataOutputStream writer) throws IOException{
writer.writeByte(tag);
writer.writeInt(bytes);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -