Exemplo n.º 1
0
 public PluginBlobWriter(string blobFile)
 {
     using (var lol = new PluginBlobReader(blobFile))
     {
         _md = lol.ReadMetadata();
     }
     var fs = new FileStream(blobFile, FileMode.Truncate);
     _writer = new BlobWriter(fs);
 }
Exemplo n.º 2
0
        public PluginBlobWriter(string blobFile)
        {
            using (var lol = new PluginBlobReader(blobFile))
            {
                _md = lol.ReadMetadata();
            }
            var fs = new FileStream(blobFile, FileMode.Truncate);

            _writer = new BlobWriter(fs);
        }
Exemplo n.º 3
0
        public PluginBlobMetadata ReadMetadata()
        {
            if (_reader.BaseStream.Length == 0)
            {
                return new PluginBlobMetadata(0, new System.Collections.Generic.Dictionary<Guid, BlobClientPlugin>());
            }

            _reader.BaseStream.Position = 0;
            var md = new PluginBlobMetadata
            {
                AvailablePluginCount = _reader.ReadInt32()
            };
            for (var i = 0; i < md.AvailablePluginCount; i++)
            {
                var dataOffset = _reader.ReadInt32();
                var dataSize = _reader.ReadInt32();
                var curPos = _reader.BaseStream.Position;
                md.PluginTable.Add(_reader.ReadGuid(), ReadPlugin(dataOffset, dataSize));
                _reader.BaseStream.Position = curPos + 16;
            }

            return md;
        }
Exemplo n.º 4
0
        public PluginBlobMetadata ReadMetadata()
        {
            if (_reader.BaseStream.Length == 0)
            {
                return(new PluginBlobMetadata(0, new System.Collections.Generic.Dictionary <Guid, BlobClientPlugin>()));
            }

            _reader.BaseStream.Position = 0;
            var md = new PluginBlobMetadata
            {
                AvailablePluginCount = _reader.ReadInt32()
            };

            for (var i = 0; i < md.AvailablePluginCount; i++)
            {
                var dataOffset = _reader.ReadInt32();
                var dataSize   = _reader.ReadInt32();
                var curPos     = _reader.BaseStream.Position;
                md.PluginTable.Add(_reader.ReadGuid(), ReadPlugin(dataOffset, dataSize));
                _reader.BaseStream.Position = curPos + 16;
            }

            return(md);
        }