mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 20:54:58 +00:00
Created S# .sln and moved project to src folder
This commit is contained in:
47
ICD.Common/Utils/IO/IcdFileStream.cs
Normal file
47
ICD.Common/Utils/IO/IcdFileStream.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
#if SIMPLSHARP
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
#else
|
||||
using System.IO;
|
||||
#endif
|
||||
|
||||
namespace ICD.Common.Utils.IO
|
||||
{
|
||||
public sealed class IcdFileStream : IcdStream
|
||||
{
|
||||
public int Position { get; set; }
|
||||
|
||||
public FileStream WrappedFileStream { get { return WrappedStream as FileStream; } }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="fileStrean"></param>
|
||||
public IcdFileStream(FileStream fileStrean)
|
||||
: base(fileStrean)
|
||||
{
|
||||
}
|
||||
|
||||
public static IcdFileStream OpenWrite(string path)
|
||||
{
|
||||
if (path == null)
|
||||
throw new ArgumentNullException("path");
|
||||
|
||||
return new IcdFileStream(File.OpenWrite(path));
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
WrappedFileStream.Flush();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
#if SIMPLSHARP
|
||||
WrappedFileStream.Close();
|
||||
#else
|
||||
WrappedFileStream.Dispose();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user