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

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

Best Java code snippets using org.mvel2.asm.ByteVector.putByteArray (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.mvel/mvel2

/**
 * Puts this symbol table's constant_pool array in the given ByteVector, preceded by the
 * constant_pool_count value.
 *
 * @param output where the JVMS ClassFile's constant_pool array must be put.
 */
void putConstantPool(final ByteVector output) {
 output.putShort(constantPoolCount).putByteArray(constantPool.data, 0, constantPool.length);
}
origin: org.mvel/mvel2

 /**
  * Puts the type_path JVMS structure corresponding to the given TypePath into the given
  * ByteVector.
  *
  * @param typePath a TypePath instance, or {@literal null} for empty paths.
  * @param output where the type path must be put.
  */
 static void put(final TypePath typePath, final ByteVector output) {
  if (typePath == null) {
   output.putByte(0);
  } else {
   int length = typePath.typePathContainer[typePath.typePathOffset] * 2 + 1;
   output.putByteArray(typePath.typePathContainer, typePath.typePathOffset, length);
  }
 }
}
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);
    }
  }    
}
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: 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: 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.mvel/mvel2

  .putShort(moduleVersionIndex)
  .putShort(requiresCount)
  .putByteArray(requires.data, 0, requires.length)
  .putShort(exportsCount)
  .putByteArray(exports.data, 0, exports.length)
  .putShort(opensCount)
  .putByteArray(opens.data, 0, opens.length)
  .putShort(usesCount)
  .putByteArray(usesIndex.data, 0, usesIndex.length)
  .putShort(providesCount)
  .putByteArray(provides.data, 0, provides.length);
if (packageCount > 0) {
 output
   .putInt(2 + packageIndex.length)
   .putShort(packageCount)
   .putByteArray(packageIndex.data, 0, packageIndex.length);
origin: org.mvel/mvel2

output.putByteArray(attributeContent.data, 0, attributeContent.length);
attribute = attribute.nextAttribute;
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: 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

annotationWriter = firstAnnotation;
while (annotationWriter != null) {
 output.putByteArray(annotationWriter.annotation.data, 0, annotationWriter.annotation.length);
 annotationWriter = annotationWriter.nextAnnotation;
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
out.putByteArray(b.data, 0, b.length);
attr = attr.next;
origin: io.virtdata/virtdata-lib-realer

ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
out.putByteArray(b.data, 0, b.length);
attr = attr.next;
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.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

aw = last;
while (aw != null) {
  out.putByteArray(aw.bv.data, 0, aw.bv.length);
  aw = aw.prev;
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: io.virtdata/virtdata-lib-realer

aw = last;
while (aw != null) {
  out.putByteArray(aw.bv.data, 0, aw.bv.length);
  aw = aw.prev;
origin: org.mvel/mvel2

int bootstrapMethodsLength = classReader.readInt(currentAttributeOffset + 2) - 2;
bootstrapMethods = new ByteVector(bootstrapMethodsLength);
bootstrapMethods.putByteArray(inputBytes, bootstrapMethodsOffset, bootstrapMethodsLength);
origin: io.virtdata/virtdata-lib-realer

} else {
  int length = typePath.b[typePath.offset] * 2 + 1;
  bv.putByteArray(typePath.b, typePath.offset, length);
org.mvel2.asmByteVectorputByteArray

Javadoc

Puts an array of bytes 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.
  • putInt
    Puts an int 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

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • orElseThrow (Optional)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • String (java.lang)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
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