/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { IoAdapterStorage.IoAdapterBin bin = new IoAdapterStorage.IoAdapterBin(_io.Open(config .Uri(), config.LockFile(), config.InitialLength(), config.ReadOnly())); ((IBlockSize)Environments.My(typeof(IBlockSize))).Register(bin); return bin; }
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public FileBin(BinConfiguration config) { bool ok = false; try { _path = new Sharpen.IO.File(config.Uri()).GetCanonicalPath(); _file = RandomAccessFileFactory.NewRandomAccessFile(_path, config.ReadOnly(), config .LockFile()); if (config.InitialLength() > 0) { Write(config.InitialLength() - 1, new byte[] { 0 }, 1); } ok = true; } catch (IOException e) { throw new Db4oIOException(e); } finally { if (!ok) { Close(); } } }
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception> public virtual IBin Open(BinConfiguration config) { var bin = new IoAdapterBin(_io.Open(config .Uri(), config.LockFile(), config.InitialLength(), config.ReadOnly())); ((IBlockSize)Environments.My(typeof(IBlockSize))).Register(bin); return(bin); }
private BinConfiguration PointToNewUri(BinConfiguration oldConfig, string newUri) { return new BinConfiguration(newUri, oldConfig.LockFile(), oldConfig.InitialLength (), oldConfig.ReadOnly()); }
private BinConfiguration PointToNewUri(BinConfiguration oldConfig, string newUri) { return(new BinConfiguration(newUri, oldConfig.LockFile(), oldConfig.InitialLength (), oldConfig.ReadOnly())); }
private static FileShare FileShareFor(BinConfiguration config) { return(config.LockFile() ? FileShare.None : FileShare.ReadWrite); }
private static FileShare FileShareFor(BinConfiguration config) { return config.LockFile() ? FileShare.None : FileShare.ReadWrite; }