类org.objectweb.asm.ByteVector源码实例Demo

下面列出了怎么用org.objectweb.asm.ByteVector的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Concurnas   文件: ModuleHashesAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(classWriter.newUTF8(algorithm));
  if (modules == null) {
    byteVector.putShort(0);
  } else {
    int numModules = modules.size();
    byteVector.putShort(numModules);
    for (int i = 0; i < numModules; ++i) {
      String module = modules.get(i);
      byte[] hash = hashes.get(i);
      byteVector
          .putShort(classWriter.newModule(module))
          .putShort(hash.length)
          .putByteArray(hash, 0, hash.length);
    }
  }
  return byteVector;
}
 
源代码2 项目: JByteMod-Beta   文件: ModuleHashesAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(classWriter.newUTF8(algorithm));
  if (modules == null) {
    byteVector.putShort(0);
  } else {
    int numModules = modules.size();
    byteVector.putShort(numModules);
    for (int i = 0; i < numModules; ++i) {
      String module = modules.get(i);
      byte[] hash = hashes.get(i);
      byteVector
          .putShort(classWriter.newModule(module))
          .putShort(hash.length)
          .putByteArray(hash, 0, hash.length);
    }
  }
  return byteVector;
}
 
源代码3 项目: JAADAS   文件: ASMBackendUtils.java
/**
 * 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;
        }
    };
}
 
源代码4 项目: JReFrameworker   文件: ModuleHashesAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(classWriter.newUTF8(algorithm));
  if (modules == null) {
    byteVector.putShort(0);
  } else {
    int numModules = modules.size();
    byteVector.putShort(numModules);
    for (int i = 0; i < numModules; ++i) {
      String module = modules.get(i);
      byte[] hash = hashes.get(i);
      byteVector
          .putShort(classWriter.newModule(module))
          .putShort(hash.length)
          .putByteArray(hash, 0, hash.length);
    }
  }
  return byteVector;
}
 
源代码5 项目: JReFrameworker   文件: ModuleHashesAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(classWriter.newUTF8(algorithm));
  if (modules == null) {
    byteVector.putShort(0);
  } else {
    int numModules = modules.size();
    byteVector.putShort(numModules);
    for (int i = 0; i < numModules; ++i) {
      String module = modules.get(i);
      byte[] hash = hashes.get(i);
      byteVector
          .putShort(classWriter.newModule(module))
          .putShort(hash.length)
          .putByteArray(hash, 0, hash.length);
    }
  }
  return byteVector;
}
 
源代码6 项目: Concurnas   文件: ModuleResolutionAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(resolution);
  return byteVector;
}
 
源代码7 项目: Concurnas   文件: ModuleTargetAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(platform == null ? 0 : classWriter.newUTF8(platform));
  return byteVector;
}
 
源代码8 项目: JByteMod-Beta   文件: ModuleResolutionAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(resolution);
  return byteVector;
}
 
源代码9 项目: JByteMod-Beta   文件: ModuleTargetAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(platform == null ? 0 : classWriter.newUTF8(platform));
  return byteVector;
}
 
源代码10 项目: JReFrameworker   文件: ModuleResolutionAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(resolution);
  return byteVector;
}
 
源代码11 项目: JReFrameworker   文件: ModuleTargetAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(platform == null ? 0 : classWriter.newUTF8(platform));
  return byteVector;
}
 
源代码12 项目: JReFrameworker   文件: ModuleResolutionAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(resolution);
  return byteVector;
}
 
源代码13 项目: JReFrameworker   文件: ModuleTargetAttribute.java
@Override
protected ByteVector write(
    final ClassWriter classWriter,
    final byte[] code,
    final int codeLength,
    final int maxStack,
    final int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byteVector.putShort(platform == null ? 0 : classWriter.newUTF8(platform));
  return byteVector;
}
 
源代码14 项目: CodenameOne   文件: RetroWeaverAttribute.java
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;
}
 
源代码15 项目: bazel   文件: DesugarMethodAttribute.java
@Override
protected ByteVector write(
    ClassWriter classWriter, byte[] code, int codeLength, int maxStack, int maxLocals) {
  ByteVector byteVector = new ByteVector();
  byte[] payloadBytes = payload.toByteArray();
  byteVector.putByteArray(payloadBytes, 0, payloadBytes.length);
  return byteVector;
}
 
源代码16 项目: HotswapAgent   文件: TestClassAdapter.java
@Override
protected ByteVector write(ClassWriter writer, byte[] code, int len,
        int maxStack, int maxLocals) {
    return new ByteVector().putByte(value);
}
 
 类所在包
 同包方法