This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added System.Buffers.ReaderWriter (#2155)
* Refactored Reader/Writer * More refactoring
- Loading branch information
1 parent
fc0c8d8
commit fd72e1a
Showing
29 changed files
with
85 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/System.Buffers.Primitives/System/Buffers/IBufferTransformation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<byte> buffer, int dataLength, out int written); | ||
} | ||
} |
111 changes: 0 additions & 111 deletions
111
src/System.Buffers.Primitives/System/Buffers/ThrowHelper.cs
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
src/System.Buffers.ReaderWriter/System.Buffers.ReaderWriter.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\..\tools\common.props" /> | ||
<PropertyGroup> | ||
<Description>Buffer Readers, Writers, and Transformations</Description> | ||
<TargetFramework>netstandard1.3</TargetFramework> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<PackageTags>Span BufferReader BufferWriter corefxlab</PackageTags> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\System.Collections.Sequences\System.Collections.Sequences.csproj" /> | ||
<ProjectReference Include="..\System.Text.Primitives\System.Text.Primitives.csproj" /> | ||
<ProjectReference Include="..\System.Text.Utf8String\System.Text.Utf8String.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesVersion)" /> | ||
</ItemGroup> | ||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters