bytebuffer.js icon indicating copy to clipboard operation
bytebuffer.js copied to clipboard

Upgraded from 2.x to 4.x, missing `length`

Open alexgorbatchev opened this issue 10 years ago • 3 comments

Hey friends,

I've just upgraded from 2.x to 4.x and now my buffers are missing length property... is that expected? What's the alternative I should be using?

alexgorbatchev avatar Aug 08 '15 00:08 alexgorbatchev

length was a bit misleading and this property has been renamed to limit with 3.X.

dcodeIO avatar Aug 08 '15 00:08 dcodeIO

Thanks for pointing that out. Curious if they can be used interchangeably? It doesn't feel like the same thing at first glance.

On Fri, Aug 7, 2015, 17:36 Daniel Wirtz [email protected] wrote:

This property has been renamed to limit with 3.X.

— Reply to this email directly or view it on GitHub https://github.com/dcodeIO/ByteBuffer.js/issues/57#issuecomment-128870569 .

alexgorbatchev avatar Aug 10 '15 03:08 alexgorbatchev

length implies the underlying buffer is of that length, which it isn't necessarily. limit is more accurate as it is the largest index at which the ByteBuffer will read to.

englercj avatar Aug 10 '15 13:08 englercj