File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace BrightData.Buffer.ByteDataProviders;
99/// <summary>
1010/// A block of byte data
1111/// </summary>
12- public ref struct ByteDataBlock ( ReadOnlySpan < byte > data , IDisposable ? disposable ) : IHaveByteData
12+ public ref struct ByteDataBlock ( ReadOnlySpan < byte > data , IDisposable ? disposable )
1313{
1414 readonly ReadOnlySpan < byte > _data = data ;
1515
Original file line number Diff line number Diff line change 11using BrightData . Buffer ;
2+ using BrightData . Buffer . ByteDataProviders ;
23using BrightData . Types ;
3- using System ;
44using CommunityToolkit . HighPerformance ;
5+ using System ;
56
67namespace BrightData . Helper
78{
@@ -37,7 +38,8 @@ interface IResolveData<out T>
3738 public DataStore ( OffsetAndSize dataTypes , IByteDataProvider dataProvider )
3839 {
3940 _dataProvider = dataProvider ;
40- _dataTypes = dataProvider . GetDataSpan ( dataTypes ) . Cast < byte , DataType > ( ) . ToArray ( ) ;
41+ using var dataTypesBlock = dataProvider . GetDataSpan ( dataTypes ) ;
42+ _dataTypes = dataTypesBlock . ByteData . Cast < byte , DataType > ( ) . ToArray ( ) ;
4143
4244 // create the data types
4345 var index = 0 ;
@@ -54,9 +56,9 @@ public T Get<T>(uint index)
5456 return default ;
5557 }
5658
57- ReadOnlySpan < byte > GetData ( uint index )
59+ ByteDataBlock GetData ( uint index )
5860 {
59- var ( type , offset , size ) = _dataTypes . Span [ ( int ) index ] ;
61+ var ( _ , offset , size ) = _dataTypes . Span [ ( int ) index ] ;
6062 return _dataProvider . GetDataSpan ( offset , size ) ;
6163 }
6264 }
You can’t perform that action at this time.
0 commit comments