Tabnine Logo
Constant.readConstant
Code IndexAdd Tabnine to your IDE (free)

How to use
readConstant
method
in
org.apache.bcel.classfile.Constant

Best Java code snippets using org.apache.bcel.classfile.Constant.readConstant (Showing top 2 results out of 315)

origin: org.apache.bcel/bcel

/**
 * Read constants from given input stream.
 *
 * @param input Input stream
 * @throws IOException
 * @throws ClassFormatException
 */
public ConstantPool(final DataInput input) throws IOException, ClassFormatException {
  byte tag;
  final int constant_pool_count = input.readUnsignedShort();
  constant_pool = new Constant[constant_pool_count];
  /* constant_pool[0] is unused by the compiler and may be used freely
   * by the implementation.
   */
  for (int i = 1; i < constant_pool_count; i++) {
    constant_pool[i] = Constant.readConstant(input);
    /* Quote from the JVM specification:
     * "All eight byte constants take up two spots in the constant pool.
     * If this is the n'th byte in the constant pool, then the next item
     * will be numbered n+2"
     *
     * Thus we have to increment the index counter.
     */
    tag = constant_pool[i].getTag();
    if ((tag == Const.CONSTANT_Double) || (tag == Const.CONSTANT_Long)) {
      i++;
    }
  }
}
origin: bcel/bcel

/**
 * Read constants from given file stream.
 *
 * @param file Input stream
 * @throws IOException
 * @throws ClassFormatException
 */
ConstantPool(DataInputStream file) throws IOException, ClassFormatException
{
 byte tag;
 constant_pool_count = file.readUnsignedShort();
 constant_pool       = new Constant[constant_pool_count];
 /* constant_pool[0] is unused by the compiler and may be used freely
  * by the implementation.
  */
 for(int i=1; i < constant_pool_count; i++) {
  constant_pool[i] = Constant.readConstant(file);
  
  /* Quote from the JVM specification:
   * "All eight byte constants take up two spots in the constant pool.
   * If this is the n'th byte in the constant pool, then the next item
   * will be numbered n+2"
   * 
   * Thus we have to increment the index counter.
   */
  tag = constant_pool[i].getTag();
  if((tag == Constants.CONSTANT_Double) || (tag == Constants.CONSTANT_Long))
 i++;
 }
}
org.apache.bcel.classfileConstantreadConstant

Javadoc

Read one constant from the given input, the type depends on a tag byte.

Popular methods of Constant

  • getTag
  • accept
    Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a
  • copy
  • dump
  • toString

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now