Exemplo n.º 1
0
        public override void Write(byte[] buffer, int offset, int count)
        {
            int num = offset + count;

            for (int index = offset; index < num; ++index)
            {
                this.ushort_0 = Stream1.smethod_2(this.ushort_0, buffer[index]);
            }
            this.stream_0.Write(buffer, offset, count);
        }
Exemplo n.º 2
0
        public override int Read(byte[] buffer, int offset, int count)
        {
            int num1 = this.stream_0.Read(buffer, offset, count);
            int num2 = offset + count;

            for (int index = offset; index < num2; ++index)
            {
                this.ushort_0 = Stream1.smethod_2(this.ushort_0, buffer[index]);
            }
            return(num1);
        }
Exemplo n.º 3
0
        public static ushort smethod_1(ushort initialCrc, byte[] data, long offset, long length)
        {
            ushort crc   = initialCrc;
            int    index = (int)offset;

            while (length-- > 0L)
            {
                crc = Stream1.smethod_2(crc, data[index]);
                ++index;
            }
            return(crc);
        }
Exemplo n.º 4
0
        private void method_0(long sectionStartPosition)
        {
            ushort num1     = (ushort)(this.memoryStream_0.Position - sectionStartPosition);
            long   position = this.memoryStream_0.Position;

            this.memoryStream_0.Position = sectionStartPosition;
            this.memoryStream_0.WriteByte((byte)((uint)num1 >> 8));
            this.memoryStream_0.WriteByte((byte)((uint)num1 & (uint)byte.MaxValue));
            this.memoryStream_0.Position = position;
            ushort num2 = Stream1.smethod_1((ushort)49345, this.memoryStream_0.GetBuffer(), sectionStartPosition, this.memoryStream_0.Length - sectionStartPosition);

            this.memoryStream_0.WriteByte((byte)((uint)num2 >> 8));
            this.memoryStream_0.WriteByte((byte)((uint)num2 & (uint)byte.MaxValue));
        }
Exemplo n.º 5
0
        public void Write()
        {
            this.method_0();
            this.stream_0.Write(Class886.byte_0, 0, Class886.byte_0.Length);
            Stream1 stream1 = new Stream1(this.stream_0, (ushort)49345);

            Class1045.smethod_9((Stream)stream1, (int)this.memoryStream_0.Length);
            if (this.dxfHeader_0.AcadVersion > DxfVersion.Dxf21 && this.dxfHeader_0.AcadMaintenanceVersion > 3 || this.dxfHeader_0.AcadVersion > DxfVersion.Dxf27)
            {
                Class1045.smethod_9((Stream)stream1, 0);
            }
            stream1.Write(this.memoryStream_0.GetBuffer(), 0, (int)this.memoryStream_0.Length);
            Class1045.smethod_6(this.stream_0, stream1.Crc);
            this.stream_0.Write(Class886.byte_1, 0, Class886.byte_1.Length);
        }
Exemplo n.º 6
0
        private void method_12()
        {
            int          sectionStartPosition1 = (int)Class653.smethod_0(this.int_0);
            int          num1 = sectionStartPosition1 + (int)this.memoryStream_0.Length;
            int          sectionStartPosition2 = num1 + (int)this.memoryStream_4.Length;
            int          sectionStartPosition3 = sectionStartPosition2 + (int)this.memoryStream_1.Length;
            int          sectionStartPosition4 = sectionStartPosition3 + (int)this.memoryStream_2.Length + (int)this.memoryStream_3.Length + (int)this.memoryStream_5.Length;
            int          sectionStartPosition5 = sectionStartPosition4 + (int)this.memoryStream_6.Length + (int)this.memoryStream_7.Length;
            MemoryStream memoryStream          = new MemoryStream();
            Interface29  streamWriter          = Class724.Create(this.dxfVersion_0, (Stream)memoryStream, Encodings.GetEncoding((int)this.dxfModel_0.Header.DrawingCodePage));

            streamWriter.imethod_13(Encodings.Ascii.GetBytes(this.dxfModel_0.Header.AcadVersionString), 0, 6);
            Interface29 nterface29 = streamWriter;

            byte[] numArray = new byte[7];
            numArray[5] = (byte)15;
            numArray[6] = (byte)1;
            byte[] bytes = numArray;
            nterface29.imethod_12(bytes);
            streamWriter.imethod_19(num1);
            streamWriter.imethod_11((byte)27);
            streamWriter.imethod_11((byte)25);
            int num2 = (int)Class952.smethod_1(this.dxfModel_0.Header.DrawingCodePage);

            streamWriter.imethod_13(LittleEndianBitConverter.GetBytes((short)num2), 0, 2);
            streamWriter.imethod_13(LittleEndianBitConverter.GetBytes(this.int_0), 0, 4);
            long position = this.stream_0.Position;

            this.method_13(streamWriter, (byte)0, sectionStartPosition2, (int)this.memoryStream_1.Length);
            this.method_13(streamWriter, (byte)1, sectionStartPosition3, (int)this.memoryStream_2.Length);
            this.method_13(streamWriter, (byte)2, sectionStartPosition4, (int)this.memoryStream_6.Length);
            this.method_13(streamWriter, (byte)3, 0, 0);
            this.method_13(streamWriter, (byte)4, sectionStartPosition5, (int)this.memoryStream_9.Length);
            this.method_13(streamWriter, (byte)5, sectionStartPosition1, (int)this.memoryStream_0.Length);
            streamWriter.Flush();
            ushort num3 = Stream1.smethod_1((ushort)49345, memoryStream.GetBuffer(), 0L, memoryStream.Length);

            streamWriter.imethod_18((short)num3);
            streamWriter.imethod_13(Class800.byte_4, 0, Class800.byte_4.Length);
            this.stream_0.Write(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
        }
Exemplo n.º 7
0
        public void Write()
        {
            this.method_0();
            this.stream_0.Write(Class1033.byte_0, 0, Class1033.byte_0.Length);
            Stream1 stream1 = new Stream1(this.stream_0, (ushort)49345);

            Class1045.smethod_9((Stream)stream1, (int)this.memoryStream_0.Length);
            if (this.dxfModel_0.Header.AcadVersion > DxfVersion.Dxf21 && this.dxfModel_0.Header.AcadMaintenanceVersion > 3 || this.dxfModel_0.Header.AcadVersion > DxfVersion.Dxf27)
            {
                Class1045.smethod_9((Stream)stream1, 0);
            }
            byte[] buffer = this.memoryStream_0.GetBuffer();
            stream1.Write(buffer, 0, (int)this.memoryStream_0.Length);
            Class1045.smethod_6(this.stream_0, stream1.Crc);
            this.stream_0.Write(Class1033.byte_1, 0, Class1033.byte_1.Length);
            if (this.dxfModel_0.Header.AcadVersion < DxfVersion.Dxf18)
            {
                return;
            }
            Class1045.smethod_9(this.stream_0, 0);
            Class1045.smethod_9(this.stream_0, 0);
        }
Exemplo n.º 8
0
        public void Write()
        {
            this.method_0();
            this.stream_0.Write(Class654.byte_0, 0, Class654.byte_0.Length);
            Stream1 stream1 = new Stream1(this.stream_0, (ushort)49345);
            int     num     = 4 + (int)this.interface29_0.Stream.Length + 2 + 8;

            Class1045.smethod_9((Stream)stream1, num);
            stream1.Write(this.memoryStream_0.GetBuffer(), 0, (int)this.memoryStream_0.Length);
            Class1045.smethod_6(this.stream_0, stream1.Crc);
            if (this.dxfModel_0.Header.AcadVersion >= DxfVersion.Dxf14)
            {
                this.stream_0.WriteByte((byte)147);
                this.stream_0.WriteByte((byte)134);
                this.stream_0.WriteByte((byte)187);
                this.stream_0.WriteByte((byte)0);
                this.stream_0.WriteByte((byte)208);
                this.stream_0.WriteByte((byte)56);
                this.stream_0.WriteByte((byte)131);
                this.stream_0.WriteByte((byte)87);
            }
            this.stream_0.Write(Class654.byte_1, 0, Class654.byte_1.Length);
        }
Exemplo n.º 9
0
 public static ushort smethod_0(ushort initialCrc, byte[] data, long length)
 {
     return(Stream1.smethod_1(initialCrc, data, 0L, length));
 }