Skip to content

Avoid throwing OffsetNotFoundException in StreamSystem.QueryOffset(string, string) #370

@bangjiehan

Description

@bangjiehan

Is your feature request related to a problem? Please describe.

I think only when there indeed is something wrong does C# throw a exception. Or at least there is some way to check before, for example call File.Exists before calling File.Read~.
There seems no way to check whether Offset exist or not before calling QueryOffset.

Describe the solution you'd like

Add one of the following overloads or modify current implementation of QueryOffset.

bool exist = StreamSystem.TryQueryOffset(string, string, out ulong offset)
ulong? offset = StreamSystem.TryQueryOffset(string, string)

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions