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

A few new functions in InStream/OutStream #1300

Merged
merged 2 commits into from Jul 29, 2018
Merged

A few new functions in InStream/OutStream #1300

merged 2 commits into from Jul 29, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jul 29, 2018

This adds a few functions to InStream and OutStream which have proven useful for me multiple times (I finally got tired of defining them in my own projects).

To InStream, I added skipBytes. This provides a heavy handed way of seeking forward in any kind of stream. Useful for e.g. parsing the header of a binary format and skipping over unused areas.

To OutStream, I added writeInt, writeIntLe, and writeIntBe. Read versions of these functions already exist in InStream.

added: writeInt, writeIntLe, and writeIntBe
this reads N bytes, discarding their values
@andrewrk andrewrk merged commit f884381 into ziglang:master Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants