diff --git a/corefxlab.sln b/corefxlab.sln
index 19e5fbdbc8f..b43c1dc38ec 100644
--- a/corefxlab.sln
+++ b/corefxlab.sln
@@ -138,6 +138,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Azure.Experimental",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Pipelines.Extensions.Tests", "tests\System.IO.Pipelines.Extensions.Tests\System.IO.Pipelines.Extensions.Tests.csproj", "{64C08774-982C-4141-8F8D-2884B6FA0E4B}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Buffers.ReaderWriter", "src\System.Buffers.ReaderWriter\System.Buffers.ReaderWriter.csproj", "{C5F9D191-CA3B-4648-B8A9-62E33B4622EB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -892,6 +894,18 @@ Global
{64C08774-982C-4141-8F8D-2884B6FA0E4B}.Release|x64.Build.0 = Release|Any CPU
{64C08774-982C-4141-8F8D-2884B6FA0E4B}.Release|x86.ActiveCfg = Release|Any CPU
{64C08774-982C-4141-8F8D-2884B6FA0E4B}.Release|x86.Build.0 = Release|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Debug|x64.Build.0 = Debug|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Debug|x86.Build.0 = Debug|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C5F9D191-CA3B-4648-B8A9-62E33B4622EB}.Release|x64.ActiveCfg = Release|Any CPU
+ {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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -959,6 +973,7 @@ Global
{0BA3C0A9-64B9-445D-B085-8FFAC09D6E37} = {3079E458-D0E6-4F99-8CAB-80011D35C7DA}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9DD4022C-A010-4A9B-BCC5-171566D4CB17}
diff --git a/src/System.Azure.Experimental/System.Azure.Experimental.csproj b/src/System.Azure.Experimental/System.Azure.Experimental.csproj
index aebc416208f..b6d0bd640b2 100644
--- a/src/System.Azure.Experimental/System.Azure.Experimental.csproj
+++ b/src/System.Azure.Experimental/System.Azure.Experimental.csproj
@@ -29,6 +29,7 @@
+
diff --git a/src/System.Binary.Base64/System/Binary/Base64Decoder.cs b/src/System.Binary.Base64/Base64Decoder.cs
similarity index 100%
rename from src/System.Binary.Base64/System/Binary/Base64Decoder.cs
rename to src/System.Binary.Base64/Base64Decoder.cs
diff --git a/src/System.Binary.Base64/System/Binary/Base64Encoder.cs b/src/System.Binary.Base64/Base64Encoder.cs
similarity index 100%
rename from src/System.Binary.Base64/System/Binary/Base64Encoder.cs
rename to src/System.Binary.Base64/Base64Encoder.cs
diff --git a/src/System.Buffers.Primitives/System/Buffers/OwnedArray.cs b/src/System.Buffers.Experimental/System/Buffers/OwnedArray.cs
similarity index 100%
rename from src/System.Buffers.Primitives/System/Buffers/OwnedArray.cs
rename to src/System.Buffers.Experimental/System/Buffers/OwnedArray.cs
diff --git a/src/System.Buffers.Primitives/System/Buffers/Transformation.cs b/src/System.Buffers.Primitives/System/Buffers/IBufferOperation.cs
similarity index 71%
rename from src/System.Buffers.Primitives/System/Buffers/Transformation.cs
rename to src/System.Buffers.Primitives/System/Buffers/IBufferOperation.cs
index cf613b84689..8b4e113c973 100644
--- a/src/System.Buffers.Primitives/System/Buffers/Transformation.cs
+++ b/src/System.Buffers.Primitives/System/Buffers/IBufferOperation.cs
@@ -8,8 +8,4 @@ public interface IBufferOperation
{
OperationStatus Execute(ReadOnlySpan input, Span output, out int consumed, out int written);
}
- public interface IBufferTransformation : IBufferOperation
- {
- OperationStatus Transform(Span buffer, int dataLength, out int written);
- }
}
diff --git a/src/System.Buffers.Primitives/System/Buffers/IBufferTransformation.cs b/src/System.Buffers.Primitives/System/Buffers/IBufferTransformation.cs
new file mode 100644
index 00000000000..bce7cfb8355
--- /dev/null
+++ b/src/System.Buffers.Primitives/System/Buffers/IBufferTransformation.cs
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Buffers
+{
+ public interface IBufferTransformation : IBufferOperation
+ {
+ OperationStatus Transform(Span buffer, int dataLength, out int written);
+ }
+}
diff --git a/src/System.Buffers.Primitives/System/Buffers/ThrowHelper.cs b/src/System.Buffers.Primitives/System/Buffers/ThrowHelper.cs
deleted file mode 100644
index 81bb4353dbd..00000000000
--- a/src/System.Buffers.Primitives/System/Buffers/ThrowHelper.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Diagnostics;
-using System.Runtime.CompilerServices;
-
-namespace System.Buffers
-{
- internal class ThrowHelper
- {
- public static void ThrowArgumentOutOfRangeException(ExceptionArgument argument)
- {
- throw GetArgumentOutOfRangeException(argument);
- }
-
- public static void ThrowInvalidOperationException(ExceptionResource resource)
- {
- throw GetInvalidOperationException(resource);
- }
-
- public static void ThrowArgumentNullException(ExceptionArgument argument)
- {
- throw GetArgumentNullException(argument);
- }
-
- public static void ThrowNotSupportedException()
- {
- throw GetNotSupportedException();
- }
-
- public static void ThrowCursorOutOfBoundsException()
- {
- throw GetCursorOutOfBoundsException();
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument)
- {
- return new ArgumentOutOfRangeException(GetArgumentName(argument));
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static InvalidOperationException GetInvalidOperationException(ExceptionResource resource)
- {
- return new InvalidOperationException(GetResourceString(resource));
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- private static NotSupportedException GetNotSupportedException()
- {
- return new NotSupportedException();
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- private static ArgumentNullException GetArgumentNullException(ExceptionArgument argument)
- {
- return new ArgumentNullException(GetArgumentName(argument));
- }
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- private static Exception GetCursorOutOfBoundsException()
- {
- return new InvalidOperationException("Cursor is out of bounds");
- }
-
- private static string GetArgumentName(ExceptionArgument argument)
- {
- Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
- "The enum value is not defined, please check the ExceptionArgument Enum.");
-
- return argument.ToString();
- }
-
- private static string GetResourceString(ExceptionResource argument)
- {
- Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), argument),
- "The enum value is not defined, please check the ExceptionResource Enum.");
-
- // Should be look up with environment resources
- string resourceString = null;
- switch (argument)
- {
- case ExceptionResource.UnexpectedSegmentType:
- resourceString = "Unexpected segment type";
- break;
- case ExceptionResource.EndCursorNotReached:
- resourceString = "Segment chain ended without reaching end cursor location";
- break;
- }
-
- resourceString = resourceString ?? $"Error ResourceKey not defined {argument}.";
-
- return resourceString;
- }
- }
-
- internal enum ExceptionArgument
- {
- destination,
- offset,
- length,
- data,
- size
- }
-
- internal enum ExceptionResource
- {
- UnexpectedSegmentType,
- EndCursorNotReached
- }
-}
diff --git a/src/System.Buffers.ReaderWriter/System.Buffers.ReaderWriter.csproj b/src/System.Buffers.ReaderWriter/System.Buffers.ReaderWriter.csproj
new file mode 100644
index 00000000000..9b4d6288aea
--- /dev/null
+++ b/src/System.Buffers.ReaderWriter/System.Buffers.ReaderWriter.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Buffer Readers, Writers, and Transformations
+ netstandard1.3
+ true
+ Span BufferReader BufferWriter corefxlab
+
+
+
+
+
+
+
+
+
+
diff --git a/src/System.Buffers.Experimental/System/Buffers/IPipeWritable.cs b/src/System.Buffers.ReaderWriter/System/Buffers/IPipeWritable.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/IPipeWritable.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/IPipeWritable.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/BufferReader_binary.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Reader/BufferReader_binary.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/BufferReader_binary.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Reader/BufferReader_binary.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/BufferReader_search.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Reader/BufferReader_search.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/BufferReader_search.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Reader/BufferReader_search.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/BufferReader_text.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Reader/BufferReader_text.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/BufferReader_text.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Reader/BufferReader_text.cs
diff --git a/src/System.Buffers.Primitives/System/Buffers/ReadOnlyBufferReader.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Reader/ReadOnlyBufferReader.cs
similarity index 100%
rename from src/System.Buffers.Primitives/System/Buffers/ReadOnlyBufferReader.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Reader/ReadOnlyBufferReader.cs
diff --git a/src/System.Buffers.Experimental/RemoveTranstomation.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Transformations/RemoveTranstomation.cs
similarity index 100%
rename from src/System.Buffers.Experimental/RemoveTranstomation.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Transformations/RemoveTranstomation.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_datetime.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_datetime.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_datetime.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_datetime.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_ints.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_ints.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_ints.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_ints.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_sequence.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_sequence.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_sequence.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_sequence.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_strings.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_strings.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_strings.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_strings.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_writable.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_writable.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/BufferWriter_writable.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/BufferWriter_writable.cs
diff --git a/src/System.Buffers.Primitives/System/Buffers/OutputExtensions.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/OutputExtensions.cs
similarity index 100%
rename from src/System.Buffers.Primitives/System/Buffers/OutputExtensions.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/OutputExtensions.cs
diff --git a/src/System.Buffers.Primitives/System/Buffers/OutputWriter.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/OutputWriter.cs
similarity index 100%
rename from src/System.Buffers.Primitives/System/Buffers/OutputWriter.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/OutputWriter.cs
diff --git a/src/System.Buffers.Experimental/System/Buffers/Text/TransformationFormat.cs b/src/System.Buffers.ReaderWriter/System/Buffers/Writer/TransformationFormat.cs
similarity index 100%
rename from src/System.Buffers.Experimental/System/Buffers/Text/TransformationFormat.cs
rename to src/System.Buffers.ReaderWriter/System/Buffers/Writer/TransformationFormat.cs
diff --git a/src/System.Buffers.ReaderWriter/System/ThrowHelper.cs b/src/System.Buffers.ReaderWriter/System/ThrowHelper.cs
new file mode 100644
index 00000000000..9c4dae67755
--- /dev/null
+++ b/src/System.Buffers.ReaderWriter/System/ThrowHelper.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+
+namespace System.Buffers
+{
+ internal class ThrowHelper
+ {
+ public static void ThrowArgumentOutOfRangeException(ExceptionArgument argument)
+ {
+ throw GetArgumentOutOfRangeException(argument);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument)
+ {
+ return new ArgumentOutOfRangeException(GetArgumentName(argument));
+ }
+
+ private static string GetArgumentName(ExceptionArgument argument)
+ {
+ Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
+ "The enum value is not defined, please check the ExceptionArgument Enum.");
+
+ return argument.ToString();
+ }
+ }
+
+ internal enum ExceptionArgument
+ {
+
+ length,
+
+ }
+}
diff --git a/src/System.Text.Http.Parser/System.Text.Http.Parser.csproj b/src/System.Text.Http.Parser/System.Text.Http.Parser.csproj
index 433a7eb6a7f..fd5d5701633 100644
--- a/src/System.Text.Http.Parser/System.Text.Http.Parser.csproj
+++ b/src/System.Text.Http.Parser/System.Text.Http.Parser.csproj
@@ -9,6 +9,7 @@
+
diff --git a/src/System.Text.Http/System.Text.Http.csproj b/src/System.Text.Http/System.Text.Http.csproj
index 61ba0685ccc..650a158a3d8 100644
--- a/src/System.Text.Http/System.Text.Http.csproj
+++ b/src/System.Text.Http/System.Text.Http.csproj
@@ -9,6 +9,7 @@
7.2
+
diff --git a/src/System.Buffers.Primitives/System/Buffers/SpanLiteralExtensions.cs b/tests/System.Buffers.Primitives.Tests/SpanLiteralExtensions.cs
similarity index 100%
rename from src/System.Buffers.Primitives/System/Buffers/SpanLiteralExtensions.cs
rename to tests/System.Buffers.Primitives.Tests/SpanLiteralExtensions.cs
diff --git a/tests/System.Buffers.Primitives.Tests/System.Buffers.Primitives.Tests.csproj b/tests/System.Buffers.Primitives.Tests/System.Buffers.Primitives.Tests.csproj
index 7b12b354396..57054cbce0d 100644
--- a/tests/System.Buffers.Primitives.Tests/System.Buffers.Primitives.Tests.csproj
+++ b/tests/System.Buffers.Primitives.Tests/System.Buffers.Primitives.Tests.csproj
@@ -22,7 +22,9 @@
+
+