Wiladams / LAPHLibs

Lua Application Programming Helper Libraries
Other
58 stars 10 forks source link

MemoryStream:ReadString does not advance position #3

Open AdallomRoy opened 11 years ago

AdallomRoy commented 11 years ago

MemoryStream:ReadString function does not advance the stream's position (in my opinion it's not like ToString, it should advance it..) I suggest to simply implement it by using the ReadBytes function.

Wiladams commented 11 years ago

Good catch!  That's quite a lurker.  I've implemented the change to advance the pointer.

I did not implement it as using ReadBytes() because that would have required me to  allocate another buffer, and ffi.string() would have created yet another copy still.

-- William


Date: Wed, 3 Apr 2013 01:39:46 -0700 From: notifications@github.com To: LAPHLibs@noreply.github.com Subject: [LAPHLibs] MemoryStream:ReadString does not advance position (#3)

MemoryStream:ReadString function does not advance the stream's position (in my opinion it's not like ToString, it should advance it..) I suggest to simply implement it by using the ReadBytes function.

— Reply to this email directly or view it on GitHubhttps://github.com/Wiladams/LAPHLibs/issues/3.