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

How do I use the same template to read different buffers? #27

Open
r03ert0 opened this issue Aug 20, 2016 · 1 comment
Open

How do I use the same template to read different buffers? #27

r03ert0 opened this issue Aug 20, 2016 · 1 comment

Comments

@r03ert0
Copy link

r03ert0 commented Aug 20, 2016

I am using struct to write the header of binary files. If the struct template is Header, is it ok to do:

Header.allocate();
var data1=Header.buffer();

fill data1 with my settings, and then do again

Header.allocate();
var data2=Header.buffer();

to create file number 2?

@xdenser
Copy link
Owner

xdenser commented Aug 21, 2016

There is no sense to call allocate twice on same instance. Reuse old buffer, create new instance, or use _setBuffer method

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

No branches or pull requests

2 participants