public override void Write(JavaWriter wtr)
            {
                wtr.Write16(wtr.ConstUtf8(tag));
                wtr.Fork();
                wtr.Write16(frames.Length);

                for (int i = 0; i < frames.Length; i++)
                {
                    byte type = frames[i].type;
                    wtr.Write8(type);
                    if (type >= 247)
                    {
                        wtr.Write16(frames[i].deltaOffset);
                    }

                    var locals = frames[i].locals;
                    if (locals == null)
                    {
                        wtr.Write16(0);
                    }
                    else
                    {
                        wtr.Write16(locals.Length);
                        for (int j = 0; j < locals.Length; j++)
                        {
                            byte localType = locals[j].type;
                            wtr.Write8(localType);
                            if (localType >= 7 && localType <= 8)
                            {
                                wtr.Write16(locals[j].extra);
                            }
                        }
                    }

                    var stack = frames[i].stack;
                    if (stack == null)
                    {
                        wtr.Write16(0);
                    }
                    else
                    {
                        wtr.Write16(stack.Length);
                        for (int j = 0; j < stack.Length; j++)
                        {
                            byte stackType = stack[j].type;
                            wtr.Write8(stackType);
                            if (stackType >= 7 && stackType <= 8)
                            {
                                wtr.Write16(stack[j].extra);
                            }
                        }
                    }
                }

                wtr.Join();
            }
Beispiel #2
0
            public override void Write(JavaWriter wtr)
            {
                var blk = BitConverter.GetBytes(value);

                if (BitConverter.IsLittleEndian)
                {
                    Array.Reverse(blk);
                }
                wtr.Write8(tag);
                wtr.WriteBlock(blk);
            }
Beispiel #3
0
 public override void Write(JavaWriter wtr)
 {
     wtr.Write8(tag);
     wtr.Write32((uint)value);
 }
Beispiel #4
0
 public override void Write(JavaWriter wtr)
 {
     wtr.Write8(tag);
     wtr.Write16(bootstrapMethodIndex);
     wtr.Write16(nameAndTypeIndex);
 }
Beispiel #5
0
 public override void Write(JavaWriter wtr)
 {
     wtr.Write8(tag);
     wtr.Write16(descriptorIndex);
 }
Beispiel #6
0
 public override void Write(JavaWriter wtr)
 {
     wtr.Write8(tag);
     wtr.Write8(referenceKind);
     wtr.Write16(referenceIndex);
 }
Beispiel #7
0
 public override void Write(JavaWriter wtr)
 {
     wtr.Write8(tag);
     wtr.WriteString(str);
 }
Beispiel #8
0
 public void Write(JavaWriter wtr, byte tag)
 {
     wtr.Write8(tag);
     wtr.Write16(classIndex);
     wtr.Write16(nameAndTypeIndex);
 }
Beispiel #9
0
 public void Write(JavaWriter wtr, byte tag)
 {
     wtr.Write8(tag);
     wtr.Write16(stringIndex);
 }
Beispiel #10
0
 public override void Write(JavaWriter wtr)
 {
     wtr.Write8(tag);
     wtr.Write32((uint)(value >> 32));
     wtr.Write32((uint)(value & 0xFFFFFFFF));
 }