FileInputStream.cs 502 B

1234567891011121314151617181920
  1. using System.IO;
  2. namespace SharpCifs.Util.Sharpen
  3. {
  4. public class FileInputStream : InputStream
  5. {
  6. public FileInputStream(FilePath file) : this(file.GetPath())
  7. {
  8. }
  9. public FileInputStream(string file)
  10. {
  11. if (!File.Exists(file))
  12. {
  13. throw new FileNotFoundException("File not found", file);
  14. }
  15. Wrapped = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
  16. }
  17. }
  18. }