/// <summary> /// Initializes a new instance of the Disk class. Differencing disks are not supported. /// </summary> /// <param name="stream">The stream to read</param> public Disk(Stream stream) { _diskImage = new DiskImageFile(stream); }
/// <summary> /// Initializes a new instance of the Disk class. Differencing disks are not supported. /// </summary> /// <param name="stream">The stream to read</param> /// <param name="ownsStream">Indicates if the new disk should take ownership of <paramref name="stream"/> lifetime.</param> public Disk(Stream stream, Ownership ownsStream) { _diskImage = new DiskImageFile(stream, ownsStream); }
/// <summary> /// Initializes a new instance of the Disk class. /// </summary> /// <param name="file">The file containing the disk image.</param> public Disk(DiskImageFile file) { _diskImage = file; }
/// <summary> /// Initializes a stream as a dynamically-sized VDI file. /// </summary> /// <param name="stream">The stream to initialize.</param> /// <param name="ownsStream">Indicates if the new instance controls the lifetime of the stream.</param> /// <param name="capacity">The desired capacity of the new disk</param> /// <returns>An object that accesses the stream as a VDI file</returns> public static Disk InitializeDynamic(Stream stream, Ownership ownsStream, long capacity) { return(new Disk(DiskImageFile.InitializeDynamic(stream, ownsStream, capacity))); }