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
|
|
@ -19,7 +19,6 @@ using System.IO;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using Server.Buffers;
|
||||
using Server.Collections;
|
||||
using Server.Logging;
|
||||
using Server.Text;
|
||||
|
||||
|
|
@ -166,15 +165,6 @@ public class BinaryFileReader : IGenericReader, IDisposable
|
|||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public int Read(Span<byte> buffer) => _reader.Read(buffer);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public BitArray ReadBitArray()
|
||||
{
|
||||
var length = ((IGenericReader)this).ReadEncodedInt();
|
||||
|
||||
// BinaryReader doesn't expose a Span slice of the buffer, so we use a custom ctor
|
||||
return new BitArray(_reader, length);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public long Seek(long offset, SeekOrigin origin) => _reader.BaseStream.Seek(offset, origin);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue