Closed
Description
I'm using ByteBuffer to fill a buffer with string data:
d = new dcodeIO.ByteBuffer()
Object { buffer: ArrayBuffer, view: DataView, offset: 0, markedOffset: -1, limit: 16, littleEndian: false, noAssert: false }
d.writeCString("aaa")
Object { buffer: ArrayBuffer, view: DataView, offset: 4, markedOffset: -1, limit: 16, littleEndian: false, noAssert: false }
d.writeCString("bbb")
Object { buffer: ArrayBuffer, view: DataView, offset: 4, markedOffset: -1, limit: 16, littleEndian: false, noAssert: false }
d.writeCString("ccc")
Object { buffer: ArrayBuffer, view: DataView, offset: 4, markedOffset: -1, limit: 16, littleEndian: false, noAssert: false }
As you can see the offset is only updated after the first operation, while all successive operations will leave the same offset, so that the third write will overwrite the content written by the second one.
If I use writeUTF8String() it is working as expected, that is the offset is correctly updated after the second write.
Is it a defect or am I missing something obvious?
TIA
Metadata
Metadata
Assignees
Labels
No labels