Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Proposal: Add BigEndian APIs to BinaryWriter and BinaryReader #77736

Closed
bunnyi116 opened this issue Nov 1, 2022 · 6 comments
Closed

API Proposal: Add BigEndian APIs to BinaryWriter and BinaryReader #77736

bunnyi116 opened this issue Nov 1, 2022 · 6 comments
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.IO
Milestone

Comments

@bunnyi116
Copy link

It is recommended that BinaryWriter and BinaryReader add support for large terminal read/write methods

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 1, 2022
@ghost
Copy link

ghost commented Nov 1, 2022

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

It is recommended that BinaryWriter and BinaryReader add support for large terminal read/write methods

Author: Bunnui
Assignees: -
Labels:

area-System.IO

Milestone: -

@stephentoub
Copy link
Member

@Bunnui, is this an API request? Can you provide more details? I don't understand what this issue is.

@bunnyi116
Copy link
Author

bunnyi116 commented Nov 1, 2022

@Bunnui, is this an API request? Can you provide more details? I don't understand what this issue is.

Because of the platform, when communicating with the Java backend, C # does not provide a way to read and write to the big end in Stream and Binary encapsulation. Although I can convert Byte endian by inverting arrays, I see that BinaryPrimitives has methods for big endians. In BinaryWriter and BinaryReader, only the LittleEndian read-write method is provided, and there is no BigEndian processing method. I discard this class to implement the case to case conversion of stream read-write.

proposal
System.IO.BinaryReader
System.IO.BinaryWriter
Add support for big end read/write methods

@bunnyi116
Copy link
Author

Because my English is not good, it is translated by machine, so maybe the words look strange, please forgive me!

@bunnyi116
Copy link
Author

@Bunnui,这是 API 请求吗?你能提供更多细节吗?我不明白这个问题是什么。

image

image

image

Something like this, if the server is using Little Endian, BinaryReader, BinaryWriter is convenient, if the server is using big endian they become a nuisance.

The ReadString method also passes in the ReadByteLength,Encoding argument instead of the initial Encoding in the constructor, because it is possible to receive a different encoding

@jozkee jozkee changed the title It is recommended that BinaryWriter and BinaryReader add support for large terminal read/write methods API Proposal: Add BigEndian APIs to BinaryWriter and BinaryReader Jan 23, 2023
@jozkee jozkee added this to the Future milestone Jan 23, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 23, 2023
@jozkee jozkee added api-suggestion Early API idea and discussion, it is NOT ready for implementation untriaged New issue has not been triaged by the area owner and removed untriaged New issue has not been triaged by the area owner labels Jan 23, 2023
@jozkee
Copy link
Member

jozkee commented Jan 23, 2023

@Bunnui I think this can be closed as duplicate of #26904.

@jozkee jozkee closed this as completed Jan 23, 2023
@jozkee jozkee closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.IO
Projects
None yet
Development

No branches or pull requests

3 participants