public bool Close() { bool result; this.Flush(); if (result = (this.backend.NotNull() && (this.Wrapped || this.backend.Close()))) this.backend = null; return result; }
public static IByteOutDevice Wrap(IBlockOutDevice device) { return device.NotNull() ? new BlockByteOutDevice(device) { Wrapped = true } : null; }
public static IByteOutDevice Open(IBlockOutDevice device) { return device.NotNull() ? new BlockByteOutDevice(device) : null; }
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; }
BlockByteOutDevice(IBlockOutDevice backend) { this.backend = backend; }
public static IBlockDevice Wrap(IBlockInDevice inDevice, IBlockOutDevice outDevice) { return inDevice.NotNull() || outDevice.NotNull() ? new BlockDeviceCombiner(inDevice, outDevice) { Wrapped = true } : null; }
protected BlockDeviceCombiner(IBlockInDevice inDevice, IBlockOutDevice outDevice) { this.inDevice = inDevice; this.outDevice = outDevice; }
public static IBlockDevice Open(IBlockInDevice inDevice, IBlockOutDevice outDevice) { return inDevice.NotNull() || outDevice.NotNull() ? new BlockDeviceCombiner(inDevice, outDevice) : null; }
public static IBlockDevice Wrap(IBlockOutDevice outDevice) { return BlockDeviceCombiner.Wrap(null, outDevice); }
public static IBlockDevice Open(IBlockOutDevice outDevice) { return BlockDeviceCombiner.Open(null, outDevice); }
public static ChunkedBlockOutDevice Open(IBlockOutDevice backend) { return backend.NotNull() ? new ChunkedBlockOutDevice(backend) : null; }
ChunkedBlockOutDevice(IBlockOutDevice backend) : this((IOutDevice)backend) { this.backendWrite = backend.Write; }
public static ChunkedBlockOutDevice Wrap(IBlockOutDevice backend) { return backend.NotNull() ? new ChunkedBlockOutDevice(backend) { Wrapped = true } : null; }
public static BlockStream Wrap(IBlockOutDevice device) { return BlockStream.Wrap(BlockDeviceCombiner.Open(device)); }