Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Unified OutputWriter and BufferWriter (#2163)
Browse files Browse the repository at this point in the history
* Unify Writers

* PR feedback
  • Loading branch information
KrzysztofCwalina authored Mar 16, 2018
1 parent 3a2a165 commit add1b01
Show file tree
Hide file tree
Showing 13 changed files with 842 additions and 324 deletions.
15 changes: 15 additions & 0 deletions corefxlab.sln
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Pipelines.Extensi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Buffers.ReaderWriter", "src\System.Buffers.ReaderWriter\System.Buffers.ReaderWriter.csproj", "{C5F9D191-CA3B-4648-B8A9-62E33B4622EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Buffers.ReaderWriter.Tests", "tests\System.Buffers.ReaderWriter.Tests\System.Buffers.ReaderWriter.Tests.csproj", "{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -906,6 +908,18 @@ Global
{C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Release|x64.Build.0 = Release|Any CPU
{C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Release|x86.ActiveCfg = Release|Any CPU
{C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Release|x86.Build.0 = Release|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Debug|x64.ActiveCfg = Debug|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Debug|x64.Build.0 = Debug|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Debug|x86.ActiveCfg = Debug|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Debug|x86.Build.0 = Debug|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Release|Any CPU.Build.0 = Release|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Release|x64.ActiveCfg = Release|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Release|x64.Build.0 = Release|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Release|x86.ActiveCfg = Release|Any CPU
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -974,6 +988,7 @@ Global
{916370AB-B0D3-4136-850B-AA12FAB23ECD} = {4B000021-5278-4F2A-B734-DE49F55D4024}
{64C08774-982C-4141-8F8D-2884B6FA0E4B} = {3079E458-D0E6-4F99-8CAB-80011D35C7DA}
{C5F9D191-CA3B-4648-B8A9-62E33B4622EB} = {4B000021-5278-4F2A-B734-DE49F55D4024}
{D9FFEC52-B701-4DB5-969C-BAC4F8EB220C} = {3079E458-D0E6-4F99-8CAB-80011D35C7DA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9DD4022C-A010-4A9B-BCC5-171566D4CB17}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.


using System.Buffers.Text;
using System.Runtime.CompilerServices;

namespace System.Buffers.Writer
{
Expand All @@ -17,8 +17,10 @@ public ref partial struct BufferWriter

static byte[] s_defaultNewline = new byte[] { (byte)'\n' };

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static BufferWriter Create(Span<byte> buffer) => new BufferWriter(buffer);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static BufferWriter<TOutput> Create<TOutput>(TOutput output)
where TOutput : IBufferWriter<byte>
=> new BufferWriter<TOutput>(output);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit add1b01

Please sign in to comment.