-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFileAbstraction.cs
49 lines (42 loc) · 1.39 KB
/
FileAbstraction.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) Arlo Godfrey. All Rights Reserved.
// Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms.
// See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information.
using System.IO;
namespace StrixMusic.Sdk.FileMetadata.Scanners
{
/// <inheritdoc/>
internal sealed class FileAbstraction : TagLib.File.IFileAbstraction
{
/// <summary>
/// Initializes a new instance of the <see cref="FileAbstraction"/> class.
/// </summary>
public FileAbstraction(string fileName, Stream file)
{
Name = fileName;
Stream = file;
}
/// <summary>
/// The name of the file.
/// </summary>
public string Name { get; }
/// <summary>
/// The stream used to construct this <see cref="FileAbstraction"/>.
/// </summary>
public Stream Stream { get; }
/// <summary>
/// A stream that can read the file.
/// </summary>
public Stream ReadStream => Stream;
/// <summary>
/// A stream that can write to the file.
/// </summary>
public Stream WriteStream => Stream;
/// <summary>
/// Closes the stream.
/// </summary>
public void CloseStream(Stream stream)
{
stream.Close();
}
}
}