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/IcdMemoryStream.cs
Normal file
47
ICD.Common/Utils/IO/IcdMemoryStream.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
#if SIMPLSHARP
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
|
||||
#else
|
||||
using System.IO;
|
||||
#endif
|
||||
|
||||
namespace ICD.Common.Utils.IO
|
||||
{
|
||||
public sealed class IcdMemoryStream : IcdStream
|
||||
{
|
||||
public int Position { get; set; }
|
||||
|
||||
public MemoryStream WrappedMemoryStream { get { return WrappedStream as MemoryStream; } }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
public IcdMemoryStream()
|
||||
: this(new MemoryStream())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="memoryStream"></param>
|
||||
public IcdMemoryStream(MemoryStream memoryStream)
|
||||
: base(memoryStream)
|
||||
{
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
WrappedMemoryStream.Flush();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
#if SIMPLSHARP
|
||||
WrappedMemoryStream.Close();
|
||||
#else
|
||||
WrappedMemoryStream.Dispose();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user