The metadata for methods in the image is split into two arrays: one for the index and the other
for data. The index contains an array of integers pointing to offsets in the data, and indexed by
type ID. The data array contains arrays of method metadata, ordered by type ID, such that all
methods declared by a class are stored consecutively, in the following format:
{
int queriedMethodsCount;
ReflectMethodEncoding[] queriedMethods[queriedMethodsCount];
int hidingMethodsCount;
SimpleMethodEncoding[] hidingMethods[hidingMethodsCount];
int declaringTypeIndex; // index in frameInfoSourceClasses
int reachableMethodsCount;
SimpleMethodEncoding[] reachableMethods[reachableMethodsCount];
} TypeEncoding;
The declaring class is encoded before the reachable methods to avoid having to be decoded when
getting the queried and hiding methods, in which case the declaring class is available as an
argument and doesn't need to be retrieved from the encoding.
The data for a queried method is stored in the following format:
{
int methodNameIndex; // index in frameInfoSourceMethodNames ("" for constructors)
int paramCount;
int[] paramTypeIndices[paramCount]; // index in frameInfoSourceClasses
int modifiers;
int returnTypeIndex; // index in frameInfoSourceClasses (void for constructors)
int exceptionTypeCount;
int[] exceptionTypeIndices[exceptionTypeCount]; // index in frameInfoSourceClasses
int signatureIndex; // index in frameInfoSourceMethodNames
int annotationsEncodingLength;
byte[] annotationsEncoding[annotationsEncodingLength];
int parameterAnnotationsEncodingLength;
byte[] parameterAnnotationsEncoding[parameterAnnotationsEncodingLength];
int typeAnnotationsEncodingLength;
byte[] typeAnnotationsEncoding[typeAnnotationsEncodingLength];
boolean hasRealParameterData;
int reflectParameterCount; // only if hasRealParameterData is true
{
int reflectParameterNameIndex; // index in frameInfoSourceMethodNames
int reflectParameterModifiers;
} reflectParameters[reflectParameterCount];
} ReflectMethodEncoding;
The data for a hiding or reachable method is stored as follows:
{
int methodNameIndex; // index in frameInfoSourceMethodNames ("" for constructors)
int paramCount;
int[] paramTypeIndices[paramCount]; // index in frameInfoSourceClasses
} SimpleMethodEncoding;