Java Code Examples for org.apache.bcel.Const#ATTR_MODULE

The following examples show how to use org.apache.bcel.Const#ATTR_MODULE . 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: Module.java    From commons-bcel with Apache License 2.0 5 votes vote down vote up
/**
 * Construct object from input stream.
 * @param name_index Index in constant pool
 * @param length Content length in bytes
 * @param input Input stream
 * @param constant_pool Array of constants
 * @throws IOException
 */
Module(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
    super(Const.ATTR_MODULE, name_index, length, constant_pool);

    moduleNameIndex = input.readUnsignedShort();
    moduleFlags = input.readUnsignedShort();
    moduleVersionIndex = input.readUnsignedShort();

    final int requires_count = input.readUnsignedShort();
    requiresTable = new ModuleRequires[requires_count];
    for (int i = 0; i < requires_count; i++) {
        requiresTable[i] = new ModuleRequires(input);
    }

    final int exports_count = input.readUnsignedShort();
    exportsTable = new ModuleExports[exports_count];
    for (int i = 0; i < exports_count; i++) {
        exportsTable[i] = new ModuleExports(input);
    }

    final int opens_count = input.readUnsignedShort();
    opensTable = new ModuleOpens[opens_count];
    for (int i = 0; i < opens_count; i++) {
        opensTable[i] = new ModuleOpens(input);
    }

    usesCount = input.readUnsignedShort();
    usesIndex = new int[usesCount];
    for (int i = 0; i < usesCount; i++) {
        usesIndex[i] = input.readUnsignedShort();
    }

    final int provides_count = input.readUnsignedShort();
    providesTable = new ModuleProvides[provides_count];
    for (int i = 0; i < provides_count; i++) {
        providesTable[i] = new ModuleProvides(input);
    }
}