Works as expected here:
Dim SLB As SLByteArrayBuffer
SLB.Initialize(32)
Log(SLB.length)
Logs 0
Your code in the first post is syntactically incorrect, is that just a typing mistake?
Yes, it was a typo, sorry.
Correct version :
Dim chunk As SLByteArrayBuffer
chunk.Initialize(32)
Note that my question is about chunk.Buffer, not chunk.Length
I wonder chunk.Buffer.Length = 32
whereas an additional chunk.AppendByte( someBuffer, 0, someBuffer.Length )
results in chunk.Buffer.Length = someBuffer.Length
I found out the problem when using chunk.Buffer . It resulted
to contain all bytes equal to chr(0) in the case when no AppenByte was called.
On the contrary, if some AppenByte is called, then chunk.Buffer just contain
the appended bytes.
I am going to have a doubt : is AppendByte a "clear+update" operation ?
The name "append" made me think as "append-back" .
Thanks for support.