Пример #1
0
        public MemoryStreamProxy(MemoryStream ms, FileIdentifier id, IDiskDriver driver)
        {
            _id     = id;
            _driver = driver;

            _sink  = ms;
            _local = new MemoryStream();

            var copier = new StreamCopier {
                ResetTarget = true
            };

            copier.Copy(_sink, _local);
        }
Пример #2
0
        public FileControlBlock Clone(FileIdentifier newId)
        {
            var result = new FileControlBlock(newId)
            {
                IsReadOnly     = IsReadOnly,
                Attributes     = Attributes,
                LastWriteTime  = LastWriteTime,
                CreationTime   = CreationTime,
                LastAccessTime = LastAccessTime,
            };

            var copier = new StreamCopier {
                ResetTarget = true
            };

            copier.Copy(Stream, result.Stream);

            return(result);
        }