Java Code Examples for org.objectweb.asm.ByteVector#putShort()

The following examples show how to use org.objectweb.asm.ByteVector#putShort() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModuleHashesAttribute.java    From Concurnas with MIT License 6 votes vote down vote up
@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;
}
 
Example 2
Source File: ModuleHashesAttribute.java    From JByteMod-Beta with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 3
Source File: ModuleHashesAttribute.java    From JReFrameworker with MIT License 6 votes vote down vote up
@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;
}
 
Example 4
Source File: ModuleHashesAttribute.java    From JReFrameworker with MIT License 6 votes vote down vote up
@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;
}
 
Example 5
Source File: ModuleResolutionAttribute.java    From Concurnas with MIT License 5 votes vote down vote up
@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;
}
 
Example 6
Source File: ModuleTargetAttribute.java    From Concurnas with MIT License 5 votes vote down vote up
@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;
}
 
Example 7
Source File: ModuleResolutionAttribute.java    From JByteMod-Beta with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 8
Source File: ModuleTargetAttribute.java    From JByteMod-Beta with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 9
Source File: ModuleResolutionAttribute.java    From JReFrameworker with MIT License 5 votes vote down vote up
@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;
}
 
Example 10
Source File: ModuleTargetAttribute.java    From JReFrameworker with MIT License 5 votes vote down vote up
@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;
}
 
Example 11
Source File: ModuleResolutionAttribute.java    From JReFrameworker with MIT License 5 votes vote down vote up
@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;
}
 
Example 12
Source File: ModuleTargetAttribute.java    From JReFrameworker with MIT License 5 votes vote down vote up
@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;
}