Esempio n. 1
0
		public bool Close()
		{
			bool result;
			this.Flush();
			if (result = (this.backend.NotNull() && (this.Wrapped || this.backend.Close())))
				this.backend = null;
			return result;
		}
Esempio n. 2
0
		public static IByteOutDevice Wrap(IBlockOutDevice device)
		{
			return device.NotNull() ? new BlockByteOutDevice(device) { Wrapped = true } : null;
		}
Esempio n. 3
0
		public static IByteOutDevice Open(IBlockOutDevice device)
		{
			return device.NotNull() ? new BlockByteOutDevice(device) : null;
		}
Esempio n. 4
0
		public virtual bool Close()
		{
			bool result;
			if (result = this.inDevice.NotNull() && !this.Wrapped)
			{
				this.inDevice.Close();
				this.inDevice = null;
			}
			if (this.outDevice.NotNull() && !this.Wrapped)
			{
				result |= this.outDevice.NotNull();
				this.outDevice.Close();
				this.outDevice = null;
			}
			return result;
		}
Esempio n. 5
0
		BlockByteOutDevice(IBlockOutDevice backend)
		{
			this.backend = backend;
		}
Esempio n. 6
0
		public static IBlockDevice Wrap(IBlockInDevice inDevice, IBlockOutDevice outDevice)
		{
			return inDevice.NotNull() || outDevice.NotNull() ? new BlockDeviceCombiner(inDevice, outDevice) { Wrapped = true } : null;
		}
Esempio n. 7
0
		protected BlockDeviceCombiner(IBlockInDevice inDevice, IBlockOutDevice outDevice)
		{
			this.inDevice = inDevice;
			this.outDevice = outDevice;
		}
Esempio n. 8
0
		public static IBlockDevice Open(IBlockInDevice inDevice, IBlockOutDevice outDevice)
		{
			return inDevice.NotNull() || outDevice.NotNull() ? new BlockDeviceCombiner(inDevice, outDevice) : null;
		}
Esempio n. 9
0
		public static IBlockDevice Wrap(IBlockOutDevice outDevice)
		{
			return BlockDeviceCombiner.Wrap(null, outDevice);
		}
Esempio n. 10
0
		public static IBlockDevice Open(IBlockOutDevice outDevice)
		{
			return BlockDeviceCombiner.Open(null, outDevice);
		}
Esempio n. 11
0
		public static ChunkedBlockOutDevice Open(IBlockOutDevice backend)
		{
			return backend.NotNull() ? new ChunkedBlockOutDevice(backend) : null;
		}
Esempio n. 12
0
		ChunkedBlockOutDevice(IBlockOutDevice backend) :
			this((IOutDevice)backend)
		{
			this.backendWrite = backend.Write;
		}
Esempio n. 13
0
		public static ChunkedBlockOutDevice Wrap(IBlockOutDevice backend)
		{
			return backend.NotNull() ? new ChunkedBlockOutDevice(backend) { Wrapped = true } : null;
		}
Esempio n. 14
0
		public static BlockStream Wrap(IBlockOutDevice device)
		{
			return BlockStream.Wrap(BlockDeviceCombiner.Open(device));
		}