[Gambas-user] "write byte[]" question

Benoît Minisini gambas at ...1...
Tue Dec 14 13:45:33 CET 2010


> I have a question how data is written to file.
> for example:
> arrObject_3 contains the capital ABC........... a.s.o
> 
> then doing:
>  Write #hMyLog, (arrObject_3.Extract(0, 16)) As Byte[]
> 
> writes the first 16 bytes to file-stream as byte-array

No. By using "As Byte[]", you are serializing a Byte array, you are not 
writing the first 16 bytes.

If you want to do that, use the Byte[].Write() method.

> then open the file written with editor shows:
> 
> AABCDEFGHIJKLMNOPAABCDEFGHIJ
> 
> the signs written except the ABC...NOP are some kind of delimiter or
> identifiers i guess.
> Where can i find a specification which datatype use which
> delimiters/identifiers ?
> 

Nowhere, unless you read the source code. The format used for serializing data 
won't be documented, as it can change. 

Data serialized by the Write instruction is intended to be unserialized by the 
Read instruction only.

Regards,

-- 
Benoît Minisini




More information about the User mailing list