Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from justcoding121/master
Browse files Browse the repository at this point in the history
Beta with API docs update
  • Loading branch information
justcoding121 authored May 10, 2018
2 parents ec665ae + 8543f21 commit 65d7cf9
Show file tree
Hide file tree
Showing 21 changed files with 2,804 additions and 375 deletions.
8 changes: 6 additions & 2 deletions StreamExtended/Network/CopyStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace StreamExtended.Network
{
/// <summary>
/// Copies the source stream to destination stream.
/// But this let users to peek and read the copying process.
/// </summary>
public class CopyStream : ICustomStreamReader, IDisposable
{
private readonly ICustomStreamReader reader;
Expand Down Expand Up @@ -126,9 +130,9 @@ public void Dispose()
if (!disposed)
{
disposed = true;
var buf = buffer;
var b = buffer;
buffer = null;
bufferPool.ReturnBuffer(buf);
bufferPool.ReturnBuffer(b);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion StreamExtended/Network/CustomBufferedPeekStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace StreamExtended.Network
{
public class CustomBufferedPeekStream : ICustomStreamReader
internal class CustomBufferedPeekStream : ICustomStreamReader
{
private readonly IBufferPool bufferPool;
private readonly ICustomStreamReader baseStream;
Expand Down
3 changes: 2 additions & 1 deletion StreamExtended/Network/CustomBufferedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace StreamExtended.Network
{
/// <summary>
/// A custom network stream inherited from stream
/// with an underlying read buffer supporting read/write of string or bytes asynchronously.
/// with an underlying read buffer supporting both read/write
/// of UTF-8 encoded string or raw bytes asynchronously from last read position.
/// </summary>
/// <seealso cref="System.IO.Stream" />
public class CustomBufferedStream : Stream, ICustomStreamReader
Expand Down
2 changes: 1 addition & 1 deletion StreamExtended/Network/DataEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace StreamExtended.Network
{
/// <summary>
/// Wraps the data sent/received.
/// Wraps the data sent/received event argument.
/// </summary>
public class DataEventArgs : EventArgs
{
Expand Down
3 changes: 3 additions & 0 deletions StreamExtended/Network/ICustomStreamReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace StreamExtended.Network
{
/// <summary>
/// This concrete implemetation of interface acts as the source stream for CopyStream class.
/// </summary>
public interface ICustomStreamReader
{
int BufferSize { get; }
Expand Down
3 changes: 3 additions & 0 deletions StreamExtended/Network/ICustomStreamWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace StreamExtended.Network
{
/// <summary>
/// A concrete implementation of this interface is required when calling CopyStream.
/// </summary>
public interface ICustomStreamWriter
{
void Write(byte[] buffer, int i, int bufferLength);
Expand Down
10 changes: 6 additions & 4 deletions StreamExtended/StreamExtended.Docs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="BufferPool\DefaultBufferPool.cs" />
<Compile Include="BufferPool\IBufferPool.cs" />
<Compile Include="ClientHelloInfo.cs" />
<Compile Include="Helpers\BufferPool.cs" />
<Compile Include="Models\SslCiphers.cs" />
<Compile Include="Models\SslExtension.cs" />
<Compile Include="Network\ClientHelloAlpnAdderStream.cs" />
<Compile Include="Network\CustomBinaryReader.cs" />
<Compile Include="Network\CopyStream.cs" />
<Compile Include="Network\CustomBufferedPeekStream.cs" />
<Compile Include="Network\CustomBufferedStream.cs" />
<Compile Include="Network\ServerHelloAlpnAdderStream.cs" />
<Compile Include="Network\DataEventArgs.cs" />
<Compile Include="Network\ICustomStreamReader.cs" />
<Compile Include="Network\ICustomStreamWriter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerHelloInfo.cs" />
<Compile Include="SslExtensions.cs" />
Expand Down
22 changes: 18 additions & 4 deletions docs/api/StreamExtended.DefaultBufferPool.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@

<h1 id="StreamExtended_DefaultBufferPool" data-uid="StreamExtended.DefaultBufferPool" class="text-break">Class DefaultBufferPool
</h1>
<div class="markdown level0 summary"><p>A concrete IBufferPool implementation using concurrent stack.
Works well for fixed buffer sizes, where if size does change then it would be global for all applications using this pool.
If your application would use variable size buffers consider implementing IBufferPool using System.Buffers from Microsoft.</p>
<div class="markdown level0 summary"><p>A concrete IBufferPool implementation using a thread-safe stack.
Works well when all consumers ask for buffers with the same size.
If your application would use size buffers consider implementing IBufferPool using System.Buffers library from Microsoft.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
Expand All @@ -96,6 +96,7 @@ <h5>Inheritance</h5>
<div classs="implements">
<h5>Implements</h5>
<div><a class="xref" href="StreamExtended.IBufferPool.html">IBufferPool</a></div>
<div><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
Expand Down Expand Up @@ -125,12 +126,22 @@ <h6><strong>Namespace</strong>: <a class="xref" href="StreamExtended.html">Strea
<h6><strong>Assembly</strong>: StreamExtended.dll</h6>
<h5 id="StreamExtended_DefaultBufferPool_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class DefaultBufferPool : IBufferPool</code></pre>
<pre><code class="lang-csharp hljs">public class DefaultBufferPool : IBufferPool, IDisposable</code></pre>
</div>
<h3 id="methods">Methods
</h3>


<a id="StreamExtended_DefaultBufferPool_Dispose_" data-uid="StreamExtended.DefaultBufferPool.Dispose*"></a>
<h4 id="StreamExtended_DefaultBufferPool_Dispose" data-uid="StreamExtended.DefaultBufferPool.Dispose">Dispose()</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
</div>


<a id="StreamExtended_DefaultBufferPool_GetBuffer_" data-uid="StreamExtended.DefaultBufferPool.GetBuffer*"></a>
<h4 id="StreamExtended_DefaultBufferPool_GetBuffer_System_Int32_" data-uid="StreamExtended.DefaultBufferPool.GetBuffer(System.Int32)">GetBuffer(Int32)</h4>
<div class="markdown level1 summary"><p>Gets a buffer.</p>
Expand Down Expand Up @@ -206,6 +217,9 @@ <h3 id="implements">Implements</h3>
<div>
<a class="xref" href="StreamExtended.IBufferPool.html">IBufferPool</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.idisposable">System.IDisposable</a>
</div>
</article>
</div>

Expand Down
8 changes: 7 additions & 1 deletion docs/api/StreamExtended.IBufferPool.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,17 @@ <h1 id="StreamExtended_IBufferPool" data-uid="StreamExtended.IBufferPool" class=
To use the default buffer pool implementation use DefaultBufferPool class.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.idisposable.dispose#System_IDisposable_Dispose">IDisposable.Dispose()</a>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="StreamExtended.html">StreamExtended</a></h6>
<h6><strong>Assembly</strong>: StreamExtended.dll</h6>
<h5 id="StreamExtended_IBufferPool_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public interface IBufferPool</code></pre>
<pre><code class="lang-csharp hljs">public interface IBufferPool : IDisposable</code></pre>
</div>
<h3 id="methods">Methods
</h3>
Expand Down
Loading

0 comments on commit 65d7cf9

Please sign in to comment.