Codota Logo
ByteVector.putInt
Code IndexAdd Codota to your IDE (free)

How to use
putInt
method
in
org.mvel2.asm.ByteVector

Best Java code snippets using org.mvel2.asm.ByteVector.putInt (Showing top 20 results out of 315)

  • Common ways to obtain ByteVector
private void myMethod () {
ByteVector b =
  • Codota Iconnew ByteVector()
  • Codota Iconnew ByteVector(initialCapacity)
  • Smart code suggestions by Codota
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

public void visitLookupSwitchInsn(
    final Label dflt,
    final int keys[],
    final Label labels[]) {
  // adds the instruction to the bytecode of the method
  int source = code.length;
  code.putByte(Opcodes.LOOKUPSWITCH);
  code.length += (4 - code.length % 4) % 4;
  dflt.put(this, code, source, true);
  code.putInt(labels.length);
  for (int i = 0; i < labels.length; ++i) {
    code.putInt(keys[i]);
    labels[i].put(this, code, source, true);
  }
  // updates currentBlock
  visitSwitchInsn(dflt, labels);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

public void visitTableSwitchInsn(
    final int min,
    final int max,
    final Label dflt,
    final Label labels[]) {
  // adds the instruction to the bytecode of the method
  int source = code.length;
  code.putByte(Opcodes.TABLESWITCH);
  code.length += (4 - code.length % 4) % 4;
  dflt.put(this, code, source, true);
  code.putInt(min).putInt(max);
  for (int i = 0; i < labels.length; ++i) {
    labels[i].put(this, code, source, true);
  }
  // updates currentBlock
  visitSwitchInsn(dflt, labels);
}
origin: org.mvel/mvel2

@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
 lastBytecodeOffset = code.length;
 // Add the instruction to the bytecode of the method.
 code.putByte(Opcodes.LOOKUPSWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
 dflt.put(code, lastBytecodeOffset, true);
 code.putInt(labels.length);
 for (int i = 0; i < labels.length; ++i) {
  code.putInt(keys[i]);
  labels[i].put(code, lastBytecodeOffset, true);
 }
 // If needed, update the maximum stack size and number of locals, and stack map frames.
 visitSwitchInsn(dflt, labels);
}
origin: org.mvel/mvel2

@Override
public void visitTableSwitchInsn(
  final int min, final int max, final Label dflt, final Label... labels) {
 lastBytecodeOffset = code.length;
 // Add the instruction to the bytecode of the method.
 code.putByte(Opcodes.TABLESWITCH).putByteArray(null, 0, (4 - code.length % 4) % 4);
 dflt.put(code, lastBytecodeOffset, true);
 code.putInt(min).putInt(max);
 for (Label label : labels) {
  label.put(code, lastBytecodeOffset, true);
 }
 // If needed, update the maximum stack size and number of locals, and stack map frames.
 visitSwitchInsn(dflt, labels);
}
origin: io.virtdata/virtdata-lib-realer

@Override
public void visitTableSwitchInsn(final int min, final int max,
    final Label dflt, final Label... labels) {
  lastCodeOffset = code.length;
  // adds the instruction to the bytecode of the method
  int source = code.length;
  code.putByte(Opcodes.TABLESWITCH);
  code.putByteArray(null, 0, (4 - code.length % 4) % 4);
  dflt.put(this, code, source, true);
  code.putInt(min).putInt(max);
  for (int i = 0; i < labels.length; ++i) {
    labels[i].put(this, code, source, true);
  }
  // updates currentBlock
  visitSwitchInsn(dflt, labels);
}
origin: io.virtdata/virtdata-lib-realer

@Override
public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
    final Label[] labels) {
  lastCodeOffset = code.length;
  // adds the instruction to the bytecode of the method
  int source = code.length;
  code.putByte(Opcodes.LOOKUPSWITCH);
  code.putByteArray(null, 0, (4 - code.length % 4) % 4);
  dflt.put(this, code, source, true);
  code.putInt(labels.length);
  for (int i = 0; i < labels.length; ++i) {
    code.putInt(keys[i]);
    labels[i].put(this, code, source, true);
  }
  // updates currentBlock
  visitSwitchInsn(dflt, labels);
}
origin: org.mvel/mvel2

/**
 * Puts a reference to this label in the bytecode of a method. If the bytecode offset of the label
 * is known, the relative bytecode offset between the label and the instruction referencing it is
 * computed and written directly. Otherwise, a null relative offset is written and a new forward
 * reference is declared for this label.
 *
 * @param code the bytecode of the method. This is where the reference is appended.
 * @param sourceInsnBytecodeOffset the bytecode offset of the instruction that contains the
 *     reference to be appended.
 * @param wideReference whether the reference must be stored in 4 bytes (instead of 2 bytes).
 */
final void put(
  final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference) {
 if ((flags & FLAG_RESOLVED) == 0) {
  if (wideReference) {
   addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_WIDE, code.length);
   code.putInt(-1);
  } else {
   addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_SHORT, code.length);
   code.putShort(-1);
  }
 } else {
  if (wideReference) {
   code.putInt(bytecodeOffset - sourceInsnBytecodeOffset);
  } else {
   code.putShort(bytecodeOffset - sourceInsnBytecodeOffset);
  }
 }
}
origin: io.virtdata/virtdata-lib-realer

void putAttributes(ByteVector out) {
  if (mainClass != 0) {
    out.putShort(cw.newUTF8("ModuleMainClass")).putInt(2).putShort(mainClass);
  }
  if (packages != null) {
    out.putShort(cw.newUTF8("ModulePackages"))
      .putInt(2 + 2 * packageCount)
      .putShort(packageCount)
      .putByteArray(packages.data, 0, packages.length);
  }
}
origin: org.mvel/mvel2

/**
 * Puts this symbol table's BootstrapMethods attribute in the given ByteVector. This includes the
 * 6 attribute header bytes and the num_bootstrap_methods value.
 *
 * @param output where the JVMS BootstrapMethods attribute must be put.
 */
void putBootstrapMethods(final ByteVector output) {
 if (bootstrapMethods != null) {
  output
    .putShort(addConstantUtf8(Constants.BOOTSTRAP_METHODS))
    .putInt(bootstrapMethods.length + 2)
    .putShort(bootstrapMethodCount)
    .putByteArray(bootstrapMethods.data, 0, bootstrapMethods.length);
 }
}
origin: io.virtdata/virtdata-lib-realer

/**
 * Puts the annotations of this annotation writer list into the given byte
 * vector.
 * 
 * @param out
 *            where the annotations must be put.
 */
void put(final ByteVector out) {
  int n = 0;
  int size = 2;
  AnnotationWriter aw = this;
  AnnotationWriter last = null;
  while (aw != null) {
    ++n;
    size += aw.bv.length;
    aw.visitEnd(); // in case user forgot to call visitEnd
    aw.prev = last;
    last = aw;
    aw = aw.next;
  }
  out.putInt(size);
  out.putShort(n);
  aw = last;
  while (aw != null) {
    out.putByteArray(aw.bv.data, 0, aw.bv.length);
    aw = aw.prev;
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

/**
 * Puts the annotations of this annotation writer list into the given byte
 * vector.
 *
 * @param out where the annotations must be put.
 */
void put(final ByteVector out) {
  int n = 0;
  int size = 2;
  AnnotationWriter aw = this;
  AnnotationWriter last = null;
  while (aw != null) {
    ++n;
    size += aw.bv.length;
    aw.visitEnd(); // in case user forgot to call visitEnd
    aw.prev = last;
    last = aw;
    aw = aw.next;
  }
  out.putInt(size);
  out.putShort(n);
  aw = last;
  while (aw != null) {
    out.putByteArray(aw.bv.data, 0, aw.bv.length);
    aw = aw.prev;
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

/**
 * Adds a float to the constant pool of the class being build. Does nothing
 * if the constant pool already contains a similar item.
 *
 * @param value the float value.
 * @return a new or already existing float item.
 */
Item newFloat(final float value) {
  key.set(value);
  Item result = get(key);
  if (result == null) {
    pool.putByte(FLOAT).putInt(key.intVal);
    result = new Item(index++, key);
    put(result);
  }
  return result;
}
origin: org.mvel/mvel2

output.putInt(attributeLength);
output.putShort(numAnnotations);
annotationWriter = firstAnnotation;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

/**
 * Adds an integer to the constant pool of the class being build. Does
 * nothing if the constant pool already contains a similar item.
 *
 * @param value the int value.
 * @return a new or already existing int item.
 */
Item newInteger(final int value) {
  key.set(value);
  Item result = get(key);
  if (result == null) {
    pool.putByte(INT).putInt(value);
    result = new Item(index++, key);
    put(result);
  }
  return result;
}
origin: io.virtdata/virtdata-lib-realer

/**
 * Adds an integer to the constant pool of the class being build. Does
 * nothing if the constant pool already contains a similar item.
 * 
 * @param value
 *            the int value.
 * @return a new or already existing int item.
 */
Item newInteger(final int value) {
  key.set(value);
  Item result = get(key);
  if (result == null) {
    pool.putByte(INT).putInt(value);
    result = new Item(index++, key);
    put(result);
  }
  return result;
}
origin: org.mvel/mvel2

  attribute.write(classWriter, code, codeLength, maxStack, maxLocals);
output.putShort(symbolTable.addConstantUtf8(attribute.type)).putInt(attributeContent.length);
output.putByteArray(attributeContent.data, 0, attributeContent.length);
attribute = attribute.nextAttribute;
origin: io.virtdata/virtdata-lib-realer

/**
 * Adds a float to the constant pool of the class being build. Does nothing
 * if the constant pool already contains a similar item.
 * 
 * @param value
 *            the float value.
 * @return a new or already existing float item.
 */
Item newFloat(final float value) {
  key.set(value);
  Item result = get(key);
  if (result == null) {
    pool.putByte(FLOAT).putInt(key.intVal);
    result = new Item(index++, key);
    put(result);
  }
  return result;
}
origin: org.mvel/mvel2

/**
 * Adds a CONSTANT_Integer_info or CONSTANT_Float_info to the constant pool of this symbol table.
 * Does nothing if the constant pool already contains a similar item.
 *
 * @param tag one of {@link Symbol#CONSTANT_INTEGER_TAG} or {@link Symbol#CONSTANT_FLOAT_TAG}.
 * @param value an int or float.
 * @return a constant pool constant with the given tag and primitive values.
 */
private Symbol addConstantIntegerOrFloat(final int tag, final int value) {
 int hashCode = hash(tag, value);
 Entry entry = get(hashCode);
 while (entry != null) {
  if (entry.tag == tag && entry.hashCode == hashCode && entry.data == value) {
   return entry;
  }
  entry = entry.next;
 }
 constantPool.putByte(tag).putInt(value);
 return put(new Entry(constantPoolCount++, tag, value, hashCode));
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

  size += panns[i] == null ? 0 : panns[i].getSize();
out.putInt(size).putByte(panns.length);
for (int i = 0; i < panns.length; ++i) {
  AnnotationWriter aw = panns[i];
origin: io.virtdata/virtdata-lib-realer

  void put(ByteVector out) {
    out.putInt(size);
    out.putShort(name).putShort(access).putShort(version);
    out.putShort(requireCount);
    if (requires != null) {
      out.putByteArray(requires.data, 0, requires.length);
    }
    out.putShort(exportCount);
    if (exports != null) {
      out.putByteArray(exports.data, 0, exports.length);
    }
    out.putShort(openCount);
    if (opens != null) {
      out.putByteArray(opens.data, 0, opens.length);
    }
    out.putShort(useCount);
    if (uses != null) {
      out.putByteArray(uses.data, 0, uses.length);
    }
    out.putShort(provideCount);
    if (provides != null) {
      out.putByteArray(provides.data, 0, provides.length);
    }
  }    
}
org.mvel2.asmByteVectorputInt

Javadoc

Puts an int into this byte vector. The byte vector is automatically enlarged if necessary.

Popular methods of ByteVector

  • <init>
    Constructs a new ByteVector from the given initial data.
  • enlarge
    Enlarges this byte vector so that it can receive 'size' more bytes.
  • put11
    Puts two bytes into this byte vector. The byte vector is automatically enlarged if necessary.
  • put12
    Puts a byte and a short into this byte vector. The byte vector is automatically enlarged if necessar
  • putByte
    Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary.
  • putByteArray
    Puts an array of bytes into this byte vector. The byte vector is automatically enlarged if necessary
  • putLong
    Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.
  • putShort
    Puts a short into this byte vector. The byte vector is automatically enlarged if necessary.
  • putUTF8
    Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary.
  • encodeUTF8
    Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary. T
  • encodeUtf8
    Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary. T
  • put112
    Puts two bytes and a short into this byte vector. The byte vector is automatically enlarged if neces
  • encodeUtf8,
  • put112,
  • put122

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Path (java.nio.file)
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now