public void Save(BinaryStreamBase stream) { stream.Write((byte)1); stream.Write(DatabaseName); stream.Write(KeyTypeID); stream.Write(ValueTypeID); stream.Write(SupportedStreamingModes.Count); foreach (var encoding in SupportedStreamingModes) { encoding.Save(stream); } }
/// <summary> /// Writes this data to the <see cref="stream"/>. /// </summary> /// <param name="stream">the stream to write data to</param> public void Save(BinaryStreamBase stream) { stream.Write((byte)0); stream.Write(Timeout.Ticks); stream.Write(MaxReturnedCount); stream.Write(MaxScanCount); stream.Write(MaxSeekCount); }
/// <summary> /// When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. /// </summary> /// <param name="buffer">An array of bytes. This method copies <paramref name="count"/> bytes from <paramref name="buffer"/> to the current stream. </param><param name="offset">The zero-based byte offset in <paramref name="buffer"/> at which to begin copying bytes to the current stream. </param><param name="count">The number of bytes to be written to the current stream. </param><filterpriority>1</filterpriority> public override void Write(byte[] buffer, int offset, int count) { BaseStream.Write(buffer, offset, count); }
/// <summary> /// Writes the first page of the SortedTree as long as the <see cref="IsDirty"/> flag is set. /// After returning, the IsDirty flag is cleared. /// </summary> public void SaveHeader(BinaryStreamBase stream) { if (!IsDirty) return; long oldPosotion = stream.Position; stream.Position = 0; stream.Write((byte)1); stream.Write(BlockSize); TreeNodeType.Save(stream); stream.Write(LastAllocatedBlock); stream.Write(RootNodeIndexAddress); //Root Index stream.Write(RootNodeLevel); //Root Index stream.Position = oldPosotion; m_isDirty = false; }