Example usage for org.eclipse.jdt.internal.compiler.classfmt ClassFileStruct utf8At

List of usage examples for org.eclipse.jdt.internal.compiler.classfmt ClassFileStruct utf8At

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.classfmt ClassFileStruct utf8At.

Prototype

public char[] utf8At(int relativeOffset, int bytesAvailable) 

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.SingleValueAttribute.java

License:Open Source License

/**
 *  Read a PlayedBy from byte code./*from w w w.  j a v  a 2s  .com*/
 */
public static SingleValueAttribute readPlayedBy(ClassFileStruct reader, int readOffset,
        int[] constantPoolOffsets) {
    int utf8Offset = constantPoolOffsets[reader.u2At(readOffset)];
    char[] value = reader.utf8At(utf8Offset + 3, reader.u2At(utf8Offset + 1));
    SingleValueAttribute result = playedByAttribute(value);
    result._reader = reader;
    return result;
}

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.SingleValueAttribute.java

License:Open Source License

/**
 * Read a "FieldTypeAnchor" attribute from byte code.
 *//*from   w w w .  java2  s.co  m*/
public static SingleValueAttribute readFieldTypeAnchor(ClassFileStruct reader, int readOffset, int structOffset,
        int[] constantPoolOffsets) {
    int idx = reader.u2At(readOffset);
    // attention: reader will add structOffset, but we appearently need to read at
    // a location without structOffset! =:-0
    int utf8Offset = constantPoolOffsets[idx] - structOffset;
    int num = reader.u2At(utf8Offset + 1);
    char[] value = reader.utf8At(utf8Offset + 3, num);
    return fieldTypeAnchorAttribute(value);
}