BdInfoFileInfo.cs 872 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.IO;
  2. using MediaBrowser.Model.IO;
  3. namespace MediaBrowser.MediaEncoding.BdInfo
  4. {
  5. class BdInfoFileInfo : BDInfo.IO.IFileInfo
  6. {
  7. FileSystemMetadata _impl = null;
  8. public string Name => _impl.Name;
  9. public string FullName => _impl.FullName;
  10. public string Extension => _impl.Extension;
  11. public long Length => _impl.Length;
  12. public bool IsDir => _impl.IsDirectory;
  13. public BdInfoFileInfo(FileSystemMetadata impl)
  14. {
  15. _impl = impl;
  16. }
  17. public System.IO.Stream OpenRead()
  18. {
  19. return new FileStream(FullName,
  20. FileMode.Open,
  21. FileAccess.Read,
  22. FileShare.Read);
  23. }
  24. public System.IO.StreamReader OpenText()
  25. {
  26. return new System.IO.StreamReader(OpenRead());
  27. }
  28. }
  29. }