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

@ -14,6 +14,8 @@
*************************************************************************/
using System;
using System.Buffers;
using System.Collections;
using System.IO;
using System.Net;
using Server.Collections;
@ -120,7 +122,17 @@ public interface IGenericReader
return new Guid(bytes);
}
BitArray ReadBitArray();
public BitArray ReadBitArray()
{
var byteArrayLength = ReadEncodedInt();
// We need an exact array size since the ctor doesn't allow for offset/length, not much we can do at this point.
var byteArray = new byte[byteArrayLength];
Read(byteArray);
return new BitArray(byteArray);
}
TextDefinition ReadTextDefinition()
{