Update Readers/Writers for Buffers & Fixes bugs (#283)
- [X] Renames PacketReader to CircularBufferReader - [X] Fixes bugs with CircularBufferReader - [X] Adds CircularBufferWriter - [X] Adds SpanWriter - [X] Adds SpanReader Bumps release version
This commit is contained in:
parent
3b7f648c27
commit
6bd4f0d265
26 changed files with 1302 additions and 351 deletions
17
Projects/Server.Tests/Utility/EncodingHelpers.cs
Normal file
17
Projects/Server.Tests/Utility/EncodingHelpers.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Server.Tests
|
||||
{
|
||||
public static class EncodingHelpers
|
||||
{
|
||||
public static Encoding GetEncoding(string bodyname) =>
|
||||
bodyname switch
|
||||
{
|
||||
"utf-8" => Utility.UTF8,
|
||||
"utf-16" => Utility.UnicodeLE,
|
||||
"utf-16BE" => Utility.Unicode,
|
||||
_ => Encoding.ASCII
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue