FileInputStream.cs 416 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. throw new FileNotFoundException ("File not found", file);
  13. }
  14. Wrapped = new FileStream (file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
  15. }
  16. }
  17. }