JavaDecompiler/JavaClass.cs
/// <summary>
/// Writes the class file to the given binary writer.
/// Remember: This must be an big endian writer!
/// </summary>
/// <param name="writer"></param>
Writes the class file to the given binary writer.
Remember: This must be an big endian writer!
Writes the class file to the given binary writer . Remember : This must be an big endian writer!
public void Write(BinaryWriter writer)
        {
            writer.Write(MagicNumber);
            writer.Write(MinorVersion);
            writer.Write(MajorVersion);
            var constants = (ushort)ConstantPool.Length;
            writer.Write(constants);
            for (int i = 0; i < constants; i++)
            {
                var constant = ConstantPool[i];
                if (constant != null)
                {
                    constant.Write(writer);
                }
            }
            writer.Write((ushort)AccessFlag);
            writer.Write(ThisClass);
            writer.Write(SuperClass);
            var interfaces = (ushort)Interfaces.Length;
            writer.Write(interfaces);
            for (int i = 0; i < interfaces; i++)
            {
                writer.Write(Interfaces[i]);
            }
            var fields = (ushort)Fields.Length;
            writer.Write(fields);
            for (int i = 0; i < fields; i++)
            {
                Fields[i].Write(writer);
            }
            var methods = (ushort)Methods.Length;
            writer.Write(methods);
            for (int i = 0; i < methods; i++)
            {
                Methods[i].Write(writer);
            }
            var attributes = (ushort)Attributes.Length;
            writer.Write(attributes);
            for (int i = 0; i < attributes; i++)
            {
                Attributes[i].Write(writer);
            }
        }
public void Write ( BinaryWriter writer ) { writer . Write ( MagicNumber ) ; writer . Write ( MinorVersion ) ; writer . Write ( MajorVersion ) ; var constants = ( ushort ) ConstantPool . Length ; writer . Write ( constants ) ; for ( int i = 0 ; i < constants ; i ++ ) { var constant = ConstantPool [ i ] ; if ( constant != null ) { constant . Write ( writer ) ; } } writer . Write ( ( ushort ) AccessFlag ) ; writer . Write ( ThisClass ) ; writer . Write ( SuperClass ) ; var interfaces = ( ushort ) Interfaces . Length ; writer . Write ( interfaces ) ; for ( int i = 0 ; i < interfaces ; i ++ ) { writer . Write ( Interfaces [ i ] ) ; } var fields = ( ushort ) Fields . Length ; writer . Write ( fields ) ; for ( int i = 0 ; i < fields ; i ++ ) { Fields [ i ] . Write ( writer ) ; } var methods = ( ushort ) Methods . Length ; writer . Write ( methods ) ; for ( int i = 0 ; i < methods ; i ++ ) { Methods [ i ] . Write ( writer ) ; } var attributes = ( ushort ) Attributes . Length ; writer . Write ( attributes ) ; for ( int i = 0 ; i < attributes ; i ++ ) { Attributes [ i ] . Write ( writer ) ; } }
Writes the class file to the given binary writer.
Writes the class file to the given binary writer .
// Writes the constant pool // Writes the interfaces // Writes the fields // Writes the methods // Writes the attributes
writer
BinaryWriter
None