Skip to content

Commit

Permalink
Merge branch 'master' into stu3/master
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethmyhra committed Aug 17, 2020
2 parents 2078de3 + 613f791 commit 5742513
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using Hl7.Fhir.Serialization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.WebUtilities;
using Spark.Core;
using Spark.Engine.Extensions;
using Spark.Engine.IO;
using System;
using System.Diagnostics;
using System.IO;
Expand Down
140 changes: 140 additions & 0 deletions src/Spark.Engine/IO/NonDisposableStream.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace Spark.Engine.IO
{
internal class NonDisposableStream : Stream
{
private readonly Stream _innerStream;

public NonDisposableStream(Stream innerStream)
{
_innerStream = innerStream;
}

/// <inheritdoc/>
public override bool CanRead => _innerStream.CanRead;

/// <inheritdoc/>
public override bool CanSeek => _innerStream.CanSeek;

/// <inheritdoc/>
public override bool CanWrite => _innerStream.CanWrite;

/// <inheritdoc/>
public override long Length => _innerStream.Length;

/// <inheritdoc/>
public override long Position { get => _innerStream.Position; set => _innerStream.Position = value; }

/// <inheritdoc/>
public override void Flush()
{

}

/// <inheritdoc/>
public override int Read(byte[] buffer, int offset, int count)
{
return _innerStream.Read(buffer, offset, count);
}

/// <inheritdoc/>
public override long Seek(long offset, SeekOrigin origin)
{
return _innerStream.Seek(offset, origin);
}

/// <inheritdoc/>
public override void SetLength(long value)
{
_innerStream.SetLength(value);
}

/// <inheritdoc/>
public override void Write(byte[] buffer, int offset, int count)
{
_innerStream.Write(buffer, offset, count);
}

/// <inheritdoc/>
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return _innerStream.ReadAsync(buffer, offset, count, cancellationToken);
}

/// <inheritdoc/>
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
return _innerStream.WriteAsync(buffer, offset, count, cancellationToken);
}

/// <inheritdoc/>
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
return _innerStream.BeginRead(buffer, offset, count, callback, state);
}

/// <inheritdoc/>
public override int EndRead(IAsyncResult asyncResult)
{
return _innerStream.EndRead(asyncResult);
}

/// <inheritdoc/>
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
return _innerStream.BeginWrite(buffer, offset, count, callback, state);
}

/// <inheritdoc/>
public override void EndWrite(IAsyncResult asyncResult)
{
_innerStream.EndWrite(asyncResult);
}

/// <inheritdoc/>
public override bool CanTimeout => _innerStream.CanTimeout;

/// <inheritdoc/>
public override void Close()
{
// Don't want to close the underlying stream, therefore we not doing anything here
}

/// <inheritdoc/>
public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
{
return _innerStream.CopyToAsync(destination, bufferSize, cancellationToken);
}

/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
// Don't want to close the underlying stream, therefore we not doing anything here
}

/// <inheritdoc/>
public override Task FlushAsync(CancellationToken cancellationToken)
{
return _innerStream.FlushAsync(cancellationToken);
}

/// <inheritdoc/>
public override int ReadByte()
{
return _innerStream.ReadByte();
}

/// <inheritdoc/>
public override void WriteByte(byte value)
{
_innerStream.WriteByte(value);
}

/// <inheritdoc/>
public override int ReadTimeout { get => _innerStream.ReadTimeout; set => _innerStream.ReadTimeout = value; }
}
}
2 changes: 1 addition & 1 deletion src/Spark.Engine/Spark.Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<PackageId>Spark.Engine.STU3</PackageId>
<Version>1.5.0</Version>
<Version>1.5.1</Version>
<Copyright>Copyright © Firely 2014, © Kufu 2018</Copyright>
<Company>Firely and Kufu</Company>
<Authors>Firely, Kufu and contributors</Authors>
Expand Down
2 changes: 1 addition & 1 deletion src/Spark.Mongo/Spark.Mongo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Spark.Mongo.STU3</PackageId>
<Version>1.5.0</Version>
<Version>1.5.1</Version>
<Copyright>Copyright © Firely 2014, © Kufu 2018</Copyright>
<Company>Firely and Kufu</Company>
<Authors>Firely, Kufu and contributors</Authors>
Expand Down
2 changes: 1 addition & 1 deletion src/Spark.Web/Spark.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreModuleName>AspNetCoreModuleV2</AspNetCoreModuleName>
<UserSecretsId>a4d3c2a3-5edd-47d1-8407-62489d5568c5</UserSecretsId>
<Version>1.5.0</Version>
<Version>1.5.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Spark/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("14.11.0.0")]
[assembly: AssemblyVersion("14.12.0.0")]

0 comments on commit 5742513

Please sign in to comment.