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

Conversation

Projects
None yet
2 participants
@dbandstra
Contributor

dbandstra 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.

dbandstra added some commits Jul 29, 2018

add int writing functions to OutStream
added: writeInt, writeIntLe, and writeIntBe
add skipBytes function to InStream
this reads N bytes, discarding their values

@andrewrk andrewrk merged commit f884381 into ziglang:master Jul 29, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment