public Tree(Stream reader, Stream writer, StartMode mode) { this.reader = reader; this.writer = writer; binaryReader = new BinaryReaderWith7BitEncoding(this.reader); binaryWriter = new BinaryWriterWith7BitEncoding(this.writer); root = mode == StartMode.Create ? new TreeNode(null, null, null, null, ReadNode, WriteNodeLazy) : ReadNode(new StreamPosition(reader.Position, null)); }
public Bag(Stream reader, Stream writer, StartMode mode) { this.reader = reader; this.writer = writer; binaryReader = new BinaryReaderWith7BitEncoding(reader); binaryWriter = new BinaryWriterWith7BitEncoding(writer); if (mode != StartMode.Open) { return; } current = ReadItem(reader.Position); }
public Queue(Stream reader, Stream writer, StartMode mode) { this.reader = reader; this.writer = writer; binaryReader = new BinaryReaderWith7BitEncoding(reader); binaryWriter = new BinaryWriterWith7BitEncoding(writer); if (mode == StartMode.Open) { currentId = binaryReader.Read7BitEncodedInt64(); var treePos = binaryReader.Read7BitEncodedInt64(); reader.Position = treePos; } tree = new Tree(reader, writer, mode); }