Skip to content

Commit

Permalink
Exposed the FillBuffer method.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeltyPlayer committed Nov 15, 2024
1 parent f54613c commit 18f6a3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Schema/Schema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Description>Library for converting classes to and from binary. Provides a C# Roslyn generator that automatically implements conversion logic for simple classes.</Description>
<PackageId>schema</PackageId>
<Title>schema</Title>
<Version>0.5.13</Version>
<Version>0.5.14</Version>
<Authors>MeltyPlayer</Authors>
</PropertyGroup>

Expand Down
2 changes: 2 additions & 0 deletions Schema/src/binary/reader/IBinaryReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ T SubreadAt<T>(long position,
int len,
Func<IBinaryReader, T> subread);

void FillBuffer(Span<byte> data, int stride);

new byte ReadByte();

byte[] ReadBytes(long count);
Expand Down
4 changes: 4 additions & 0 deletions Schema/src/binary/reader/SchemaBinaryReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ private void Dispose(bool disposing) {
this.disposed_ = true;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void FillBuffer(Span<byte> data, int stride)
=> this.bufferedStream_.FillBuffer(data, stride);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void FillBuffer_(long count, int? optStride = null)
=> this.bufferedStream_.FillBuffer(count, optStride);
Expand Down

0 comments on commit 18f6a3b

Please sign in to comment.