fix: Removes custom BitArray (#1597)

### Summary

The BitArray class will be optimized over the next several years for various platforms/hardware and maintaining a duplicate for serialization is not practical. Removing the custom implementation. Recommend against using BitArray for serialization unless it is absolutely necessary.
This commit is contained in:
Kamron Batman 2023-11-17 14:37:07 -08:00 committed by GitHub
parent a1dffd10ce
commit e9642d61f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 1489 deletions

View file

@ -20,7 +20,6 @@ using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using Server.Collections;
using Server.Text;
namespace Server;
@ -135,17 +134,6 @@ public class BufferWriter : IGenericWriter
Index += length;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Write(BitArray bitArray)
{
var byteLength = BitArray.GetByteArrayLengthFromBitLength(bitArray.Length);
((IGenericWriter)this).WriteEncodedInt(bitArray.Length);
FlushIfNeeded(byteLength);
bitArray.CopyTo(_buffer.AsSpan((int)Index, byteLength));
Index += byteLength;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public virtual long Seek(long offset, SeekOrigin origin)
{