Ejemplo n.º 1
0
 public void Write(DataBase <T> pDataBase, IDbSource pTarget)
 {
     lock (_syncLock)
     {
         var stream = pTarget.GetStream();
         _serializer.Write(pDataBase, stream);
         StreamUtils.CloseStream(stream);
     }
 }
Ejemplo n.º 2
0
        public DataBase <T> Read(IDbSource pSource)
        {
            DataBase <T> dataBase;

            lock (_syncLock)
            {
                var stream = pSource.GetStream();
                dataBase = _serializer.Read(stream);
                StreamUtils.CloseStream(stream);

                dataBase.DbSource = pSource;
            }

            return(dataBase);
        }