本文整理汇总了Java中javassist.bytecode.ByteArray类的典型用法代码示例。如果您正苦于以下问题:Java ByteArray类的具体用法?Java ByteArray怎么用?Java ByteArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ByteArray类属于javassist.bytecode包,在下文中一共展示了ByteArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: renameLocalVariableTypeAttribute
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private static void renameLocalVariableTypeAttribute(LocalVariableTypeAttribute attribute, ReplacerClassMap map) {
// adapted from LocalVariableAttribute.renameClass()
ConstPool cp = attribute.getConstPool();
int n = attribute.tableLength();
byte[] info = attribute.get();
for (int i = 0; i < n; ++i) {
int pos = i * 10 + 2;
int index = ByteArray.readU16bit(info, pos + 6);
if (index != 0) {
String signature = cp.getUtf8Info(index);
String newSignature = renameLocalVariableSignature(signature, map);
if (newSignature != null) {
ByteArray.write16bit(cp.addUtf8Info(newSignature), info, pos + 6);
}
}
}
}
开发者ID:cccssw,项目名称:enigma-vk,代码行数:19,代码来源:ClassRenamer.java
示例2: doInvokeMethod
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode {
int i = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getMethodrefType(i);
checkParamTypes(desc, 1);
if (notStatic) {
String className = cpool.getMethodrefClassName(i);
TypeData target = stackTypes[--stackTop];
if (target instanceof TypeData.UninitTypeVar && target.isUninit())
constructorCalled(target, ((TypeData.UninitTypeVar)target).offset());
else if (target instanceof TypeData.UninitData)
constructorCalled(target, ((TypeData.UninitData)target).offset());
target.setType(className, classPool);
}
pushMemberType(desc);
return 3;
}
开发者ID:MeRPG2,项目名称:EndHQ-Libraries,代码行数:19,代码来源:Tracer.java
示例3: doPutField
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doPutField(int pos, byte[] code, boolean notStatic) throws BadBytecode {
int index = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getFieldrefType(index);
stackTop -= Descriptor.dataSize(desc);
char c = desc.charAt(0);
if (c == 'L')
TypeData.setType(stackTypes[stackTop], getFieldClassName(desc, 0), classPool);
else if (c == '[')
TypeData.setType(stackTypes[stackTop], desc, classPool);
setFieldTarget(notStatic, index);
return 3;
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:14,代码来源:Tracer.java
示例4: doGetField
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doGetField(int pos, byte[] code, boolean notStatic) throws BadBytecode {
int index = ByteArray.readU16bit(code, pos + 1);
setFieldTarget(notStatic, index);
String desc = cpool.getFieldrefType(index);
pushMemberType(desc);
return 3;
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:8,代码来源:Tracer.java
示例5: doMultiANewArray
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doMultiANewArray(int pos, byte[] code) {
int i = ByteArray.readU16bit(code, pos + 1);
int dim = code[pos + 3] & 0xff;
stackTop -= dim - 1;
String type = cpool.getClassInfo(i).replace('.', '/');
stackTypes[stackTop - 1] = new TypeData.ClassName(type);
return 4;
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:10,代码来源:Tracer.java
示例6: doInvokeMethod
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode {
int i = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getMethodrefType(i);
checkParamTypes(desc, 1);
if (notStatic) {
String className = cpool.getMethodrefClassName(i);
TypeData.setType(stackTypes[--stackTop], className, classPool);
}
pushMemberType(desc);
return 3;
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:13,代码来源:Tracer.java
示例7: doInvokeIntfMethod
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doInvokeIntfMethod(int pos, byte[] code) throws BadBytecode {
int i = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getInterfaceMethodrefType(i);
checkParamTypes(desc, 1);
String className = cpool.getInterfaceMethodrefClassName(i);
TypeData.setType(stackTypes[--stackTop], className, classPool);
pushMemberType(desc);
return 5;
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:10,代码来源:Tracer.java
示例8: doPutField
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doPutField(int pos, byte[] code, boolean notStatic) throws BadBytecode {
int index = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getFieldrefType(index);
stackTop -= Descriptor.dataSize(desc);
char c = desc.charAt(0);
if (c == 'L')
stackTypes[stackTop].setType(getFieldClassName(desc, 0), classPool);
else if (c == '[')
stackTypes[stackTop].setType(desc, classPool);
setFieldTarget(notStatic, index);
return 3;
}
开发者ID:MeRPG2,项目名称:EndHQ-Libraries,代码行数:14,代码来源:Tracer.java
示例9: doInvokeIntfMethod
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doInvokeIntfMethod(int pos, byte[] code) throws BadBytecode {
int i = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getInterfaceMethodrefType(i);
checkParamTypes(desc, 1);
String className = cpool.getInterfaceMethodrefClassName(i);
stackTypes[--stackTop].setType(className, classPool);
pushMemberType(desc);
return 5;
}
开发者ID:MeRPG2,项目名称:EndHQ-Libraries,代码行数:10,代码来源:Tracer.java
示例10: doInvokeDynamic
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private int doInvokeDynamic(int pos, byte[] code) throws BadBytecode {
int i = ByteArray.readU16bit(code, pos + 1);
String desc = cpool.getInvokeDynamicType(i);
checkParamTypes(desc, 1);
// assume CosntPool#REF_invokeStatic
/* TypeData target = stackTypes[--stackTop];
if (target instanceof TypeData.UninitTypeVar && target.isUninit())
constructorCalled((TypeData.UninitTypeVar)target);
*/
pushMemberType(desc);
return 5;
}
开发者ID:MeRPG2,项目名称:EndHQ-Libraries,代码行数:15,代码来源:Tracer.java
示例11: renameVariable
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private void renameVariable(LocalVariableAttribute table, int i, int stringId) {
// based off of LocalVariableAttribute.nameIndex()
ByteArray.write16bit(stringId, table.get(), i*10 + 6);
}
开发者ID:cccssw,项目名称:enigma-vk,代码行数:5,代码来源:LocalVariableRenamer.java
示例12: write16bit
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private void write16bit(int value) throws IOException {
byte[] buf = new byte[2];
ByteArray.write16bit(value, buf, 0);
output.write(buf);
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:6,代码来源:AnnotationsWriter.java
示例13: doWIDE_XLOAD
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private void doWIDE_XLOAD(int pos, byte[] code, TypeData type) {
int index = ByteArray.readU16bit(code, pos + 2);
doXLOAD(index, type);
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:5,代码来源:Tracer.java
示例14: doWIDE_STORE
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private void doWIDE_STORE(int pos, byte[] code, TypeData type) {
int index = ByteArray.readU16bit(code, pos + 2);
doXSTORE(index, type);
}
开发者ID:AndreJCL,项目名称:JCL,代码行数:5,代码来源:Tracer.java
示例15: renameVariable
import javassist.bytecode.ByteArray; //导入依赖的package包/类
private void renameVariable(LocalVariableAttribute table, int i,
int stringId)
{
// based off of LocalVariableAttribute.nameIndex()
ByteArray.write16bit(stringId, table.get(), i * 10 + 6);
}
开发者ID:Wurst-Imperium,项目名称:Wurst-Enigma,代码行数:7,代码来源:LocalVariableRenamer.java
注:本文中的javassist.bytecode.ByteArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论