JoshGlazebrook / smart-buffer

smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.
https://www.npmjs.com/package/smart-buffer
MIT License
102 stars 18 forks source link

readInt____ getting incorrect values. #11

Closed spAnser closed 7 years ago

spAnser commented 7 years ago

readInt____ should be returning signed values not unsigned values.

JoshGlazebrook commented 7 years ago

Yikes. This has been fixed in https://github.com/JoshGlazebrook/smart-buffer/commit/603d6ebe20a9b795142323f5e987f6e99cc70d24. Looks like it was from the re-factor in Typescript.

3.0.1 has been published.

spAnser commented 7 years ago

Thanks for the quick fix.

JoshGlazebrook commented 7 years ago

Let me know if you find anything else. (Hopefully not)

spAnser commented 7 years ago

Well you have a .remaining() is there an opposite function that returns the current position?

Was just a though when I was testing some things.

JoshGlazebrook commented 7 years ago

If you're using JavaScript you could access the internal readOffset and writeOffset variables. Otherwise you could do length - remaining(), but I can add this to a list of things to add in the future.