/// <summary>
        /// Reads a single bootstrap methods attribute at the current position of the provided reader.
        /// </summary>
        /// <param name="reader">The reader to use.</param>
        /// <returns>The bootstrap methods attribute that was read.</returns>
        public static BootstrapMethodsAttribute FromReader(IBigEndianReader reader)
        {
            var result = new BootstrapMethodsAttribute();

            ushort count = reader.ReadUInt16();

            for (int i = 0; i < count; i++)
            {
                result.BootstrapMethods.Add(BootstrapMethodInfo.FromReader(reader));
            }

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Reads a single bootstrap methods attribute at the current position of the provided reader.
        /// </summary>
        /// <param name="reader">The reader to use.</param>
        /// <returns>The bootstrap methods attribute that was read.</returns>
        public static BootstrapMethodInfo FromReader(IBigEndianReader reader)
        {
            var result = new BootstrapMethodInfo
            {
                MethodRefIndex = reader.ReadUInt16(),
            };

            ushort count = reader.ReadUInt16();

            for (int i = 0; i < count; i++)
            {
                result.Arguments.Add(reader.ReadUInt16());
            }

            return(result);
        }