diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-01-08 18:10:17 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2020-01-08 18:10:17 +0100 |
| commit | c3752b1a3080f6f54c77a436c7d0b309792b8872 (patch) | |
| tree | c762d033f487407f483b03e2f16ac7bec44ad22c /MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs | |
| parent | 9dfafb9e9fcddb253b157fe03b085b7fceef4290 (diff) | |
| parent | 124a852787ff94201de452a952eb31376beafe12 (diff) | |
Merge branch 'master' into scanerrors
Diffstat (limited to 'MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs b/MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs new file mode 100644 index 0000000000..de9d7cb784 --- /dev/null +++ b/MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs @@ -0,0 +1,40 @@ +using MediaBrowser.Model.IO; + +namespace MediaBrowser.MediaEncoding.BdInfo +{ + class BdInfoFileInfo : BDInfo.IO.IFileInfo + { + IFileSystem _fileSystem = null; + + FileSystemMetadata _impl = null; + + public string Name => _impl.Name; + + public string FullName => _impl.FullName; + + public string Extension => _impl.Extension; + + public long Length => _impl.Length; + + public bool IsDir => _impl.IsDirectory; + + public BdInfoFileInfo(IFileSystem fileSystem, FileSystemMetadata impl) + { + _fileSystem = fileSystem; + _impl = impl; + } + + public System.IO.Stream OpenRead() + { + return _fileSystem.GetFileStream(FullName, + FileOpenMode.Open, + FileAccessMode.Read, + FileShareMode.Read); + } + + public System.IO.StreamReader OpenText() + { + return new System.IO.StreamReader(OpenRead()); + } + } +} |
