-
Notifications
You must be signed in to change notification settings - Fork 155
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
char array #28
Comments
Well, it's 32 bytes. You may either You might also want to take a look at the API docs. |
Sorry, I still don't get it. I currently need to write it. It's actually a string. Let us say
Could be
If I try to
|
var s = "Buffer",
o = bb.offset;
bb.writeString(s);
while (bb.offset < o + 16)
bb.writeUint8(0);
... |
Would love to see this get supported with bytebuffer. Cheers, great as always. |
You may also extend the prototype with your use case specific code for comfort and a bit of speed: mybytebuffer.js var ByteBuffer = require("bytebuffer");
ByteBuffer.prototype.writeStringPadded = function(s, len) {
var end = this.offset + len;
this.ensureCapacity(end);
this.writeString(s);
while (this.offset < end)
this.writeUint8(0);
return this;
};
module.exports = ByteBuffer; var ByteBuffer = require("mybytebuffer.js");
var bb = new ByteBuffer();
bb.writeStringPadded("Buffer", 16);
... |
How would this be on byte buffer?
The text was updated successfully, but these errors were encountered: