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:
parent
a1dffd10ce
commit
e9642d61f1
9 changed files with 32 additions and 1489 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue