Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Add CreateFile overload that doesn't require a string object #535

Merged
merged 2 commits into from
Oct 27, 2020

Conversation

AArnott
Copy link
Collaborator

@AArnott AArnott commented Oct 27, 2020

No description provided.

@qmfrederik
Copy link
Contributor

nit: would it be possible to have System.ReadOnlySpan<byte>, too?

@AArnott
Copy link
Collaborator Author

AArnott commented Oct 27, 2020

@qmfrederik said:

would it be possible to have System.ReadOnlySpan, too?

We could, but it wouldn't convey that it should be UTF-16 encoded. But given a ReadOnlySpan<byte>, you can readily cast to ReadOnlySpan<char> (i.e. without copying data) using this:

ReadOnlySpan<byte> bytes; // initialized elsewhere, assumed to be UTF-16 encoded chars
ReadOnlySpan<char> chars = MemoryMarshal.Cast<byte, char>(bytes);

@qmfrederik
Copy link
Contributor

Fair enough, thanks!

@AArnott AArnott merged commit 39bdc19 into master Oct 27, 2020
@AArnott AArnott deleted the createFilePointer branch October 27, 2020 16:21
@qmfrederik
Copy link
Contributor

@AArnott Thanks. Is CI still configured for this repo? Looks like the last CI run dates from early October?

@AArnott
Copy link
Collaborator Author

AArnott commented Oct 27, 2020

@qmfrederik Oh, snap. Ya Azure Pipelines triggers broke for GitHub triggers all over the place. I finally found a workaround but hadn't applied it to this one. I've fixed it and queued another CI build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants