예제 #1
0
        internal byte[] WriteObjectData()
        {
            MemoryStream   memoryStream   = new MemoryStream();
            BinaryWriter   writer         = new BinaryWriter(memoryStream);
            ObjectStreamer objectStreamer = this.file.streamerManager.streamerByType[this.obj.GetType()];

            objectStreamer.Write(writer, this.obj);
            byte[] array = memoryStream.ToArray();
            if (this.compressionLevel == 0)
            {
                return(array);
            }
            QuickLZ quickLZ = new QuickLZ();

            return(quickLZ.Compress(array));
        }
예제 #2
0
        internal override void Write(BinaryWriter writer)
        {
            MemoryStream memoryStream = new MemoryStream();
            BinaryWriter writer2      = new BinaryWriter(memoryStream);

            for (int i = 0; i < this.count; i++)
            {
                this.file.streamerManager.Serialize(writer2, this.objects[i]);
            }
            byte[] array = memoryStream.ToArray();
            if (this.compressionLevel != 0)
            {
                QuickLZ quickLZ = new QuickLZ();
                array = quickLZ.Compress(array);
            }
            this.keyLength = 77;
            this.objLength = array.Length;
            if (this.recLength == -1)
            {
                this.recLength = this.keyLength + this.objLength;
            }
            writer.Write(this.label);
            writer.Write(this.deleted);
            writer.Write(this.dateTime.Ticks);
            writer.Write(this.position);
            writer.Write(this.keyLength);
            writer.Write(this.objLength);
            writer.Write(this.recLength);
            writer.Write(this.compressionMethod);
            writer.Write(this.compressionLevel);
            writer.Write(this.typeId);
            writer.Write(this.size);
            writer.Write(this.count);
            writer.Write(this.dateTime1.Ticks);
            writer.Write(this.dateTime2.Ticks);
            writer.Write(this.prev);
            writer.Write(this.next);
            writer.Write(array, 0, array.Length);
        }
예제 #3
0
파일: DataKey.cs 프로젝트: ForTrade/CSharp
		internal override void Write(BinaryWriter writer)
		{
			MemoryStream memoryStream = new MemoryStream();
			BinaryWriter writer2 = new BinaryWriter(memoryStream);
			for (int i = 0; i < this.count; i++)
			{
				this.file.streamerManager.Serialize(writer2, this.objects[i]);
			}
			byte[] array = memoryStream.ToArray();
			if (this.compressionLevel != 0)
			{
				QuickLZ quickLZ = new QuickLZ();
				array = quickLZ.Compress(array);
			}
			this.keyLength = 77;
			this.objLength = array.Length;
			if (this.recLength == -1)
			{
				this.recLength = this.keyLength + this.objLength;
			}
			writer.Write(this.label);
			writer.Write(this.deleted);
			writer.Write(this.dateTime.Ticks);
			writer.Write(this.position);
			writer.Write(this.keyLength);
			writer.Write(this.objLength);
			writer.Write(this.recLength);
			writer.Write(this.compressionMethod);
			writer.Write(this.compressionLevel);
			writer.Write(this.typeId);
			writer.Write(this.size);
			writer.Write(this.count);
			writer.Write(this.dateTime1.Ticks);
			writer.Write(this.dateTime2.Ticks);
			writer.Write(this.prev);
			writer.Write(this.next);
			writer.Write(array, 0, array.Length);
		}