本文整理汇总了Java中org.objectweb.asm.ByteVector类的典型用法代码示例。如果您正苦于以下问题:Java ByteVector类的具体用法?Java ByteVector怎么用?Java ByteVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ByteVector类属于org.objectweb.asm包,在下文中一共展示了ByteVector类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createASMAttribute
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
/**
* Create an ASM attribute from an Soot attribute
* @param attr Soot attribute
* @return ASM attribute
*/
public static org.objectweb.asm.Attribute createASMAttribute(Attribute attr) {
final Attribute a = attr;
return new org.objectweb.asm.Attribute(
attr.getName()) {
@Override
protected ByteVector write(final ClassWriter cw,
final byte[] code, final int len,
final int maxStack, final int maxLocals) {
ByteVector result = new ByteVector();
result.putByteArray(a.getValue(), 0,
a.getValue().length);
return result;
}
};
}
示例2: writeTypeInfos
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
private void writeTypeInfos(
ByteVector bv,
ClassWriter cw,
List info,
int start,
int end)
{
for (int j = start; j < end; j++) {
StackMapType typeInfo = (StackMapType) info.get(j);
bv.putByte(typeInfo.getType());
switch (typeInfo.getType()) {
case StackMapType.ITEM_Object: //
bv.putShort(cw.newClass(typeInfo.getObject()));
break;
case StackMapType.ITEM_Uninitialized: //
bv.putShort(typeInfo.getLabel().getOffset());
break;
}
}
}
示例3: writeTypeInfo
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
private void writeTypeInfo(ByteVector bv, ClassWriter cw, List info, int max)
{
if (max > StackMapAttribute.MAX_SIZE) {
bv.putInt(info.size());
} else {
bv.putShort(info.size());
}
for (int j = 0; j < info.size(); j++) {
StackMapType typeInfo = (StackMapType) info.get(j);
bv.putByte(typeInfo.getType());
switch (typeInfo.getType()) {
case StackMapType.ITEM_Object: //
bv.putShort(cw.newClass(typeInfo.getObject()));
break;
case StackMapType.ITEM_Uninitialized: //
bv.putShort(typeInfo.getLabel().getOffset());
break;
}
}
}
示例4: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
protected ByteVector write(
ClassWriter cw,
byte[] code,
int len,
int maxStack,
int maxLocals)
{
ByteVector bv = new ByteVector();
if (code != null && code.length > MAX_SIZE) { // TODO verify value
bv.putInt(frames.size());
} else {
bv.putShort(frames.size());
}
for (int i = 0; i < frames.size(); i++) {
writeFrame((StackMapFrame) frames.get(i),
cw,
maxStack,
maxLocals,
bv);
}
return bv;
}
示例5: writeSize
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
private void writeSize(int delta, ByteVector bv, boolean isExt) {
if (isExt) {
bv.putInt(delta);
} else {
bv.putShort(delta);
}
}
示例6: writeFrame
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
private void writeFrame(
StackMapFrame frame,
ClassWriter cw,
int maxStack,
int maxLocals,
ByteVector bv)
{
bv.putShort(frame.label.getOffset());
writeTypeInfo(bv, cw, frame.locals, maxLocals);
writeTypeInfo(bv, cw, frame.stack, maxStack);
}
示例7: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
protected ByteVector write(ClassWriter arg0,
byte[] arg1,
int arg2,
int arg3,
int arg4) {
return new ByteVector();
}
示例8: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
protected ByteVector write(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
ByteVector bv = new ByteVector();
bv.putInt(retroweaverBuildNumber);
bv.putInt(originalClassVersion);
bv.putLong(timestamp);
return bv;
}
示例9: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
@Override
protected ByteVector write(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
return new ByteVector();
}
示例10: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
@Override
protected ByteVector write(
final ClassWriter cw,
final byte[] code,
final int len,
final int maxStack,
final int maxLocals)
{
return new ByteVector().putShort(cw.newUTF8(comment));
}
示例11: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
@Override
protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals)
{
return new ByteVector( 0 );
}
示例12: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
final int len, final int maxStack, final int maxLocals) {
return new ByteVector();
}
示例13: write
import org.objectweb.asm.ByteVector; //导入依赖的package包/类
@Override
protected ByteVector write(final ClassWriter cw, final byte[] code,
final int len, final int maxStack, final int maxLocals) {
return new ByteVector().putShort(cw.newUTF8(comment));
}