当前位置: 首页>>代码示例>>Java>>正文


Java ByteVector类代码示例

本文整理汇总了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;
        }
    };
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:21,代码来源:ASMBackendUtils.java

示例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;

        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:24,代码来源:StackMapTableAttribute.java

示例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;

        }
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:StackMapAttribute.java

示例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;
}
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:StackMapAttribute.java

示例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);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:8,代码来源:StackMapTableAttribute.java

示例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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:12,代码来源:StackMapAttribute.java

示例7: write

import org.objectweb.asm.ByteVector; //导入依赖的package包/类
protected ByteVector write(ClassWriter arg0,
                           byte[] arg1,
                           int arg2,
                           int arg3,
                           int arg4) {
    return new ByteVector();
}
 
开发者ID:jcarder,项目名称:jcarder,代码行数:8,代码来源:InstrumentedAttribute.java

示例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;
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:16,代码来源:RetroWeaverAttribute.java

示例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();
}
 
开发者ID:nxmatic,项目名称:objectweb-asm-4.0,代码行数:11,代码来源:JasminifierClassAdapterTest.java

示例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));
}
 
开发者ID:nxmatic,项目名称:objectweb-asm-4.0,代码行数:11,代码来源:Attributes.java

示例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 );
}
 
开发者ID:SpigotMC,项目名称:Simulare,代码行数:6,代码来源:TransformMojo.java

示例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();
}
 
开发者ID:lrytz,项目名称:asm-legacy-svn-clone,代码行数:6,代码来源:JasminifierClassAdapterTest.java

示例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));
}
 
开发者ID:lrytz,项目名称:asm-legacy-svn-clone,代码行数:6,代码来源:Attributes.java


注:本文中的org.objectweb.asm.ByteVector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。