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
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
|
@ -221,21 +222,6 @@ public class BufferReader : IGenericReader
|
|||
return length;
|
||||
}
|
||||
|
||||
public BitArray ReadBitArray()
|
||||
{
|
||||
var bitLength = ((IGenericReader)this).ReadEncodedInt();
|
||||
var length = BitArray.GetByteArrayLengthFromBitLength(bitLength);
|
||||
|
||||
if (length > _buffer.Length - _position)
|
||||
{
|
||||
throw new OutOfMemoryException();
|
||||
}
|
||||
|
||||
var bitArray = new BitArray(_buffer.AsSpan(_position, length), bitLength);
|
||||
_position += length;
|
||||
return bitArray;
|
||||
}
|
||||
|
||||
public virtual long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
Debug.Assert(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue