On 05/08/2013 02:46 PM, Meta wrote:

>> For example:
>> ubyte[] data = [5, 34, 9, 45];
>> file.rawWrite(data); // OKAY
>>
>> ubyte[] data = [0, 0, 0, 45];
>> file.rawWrite(data); // NOT OKAY
>
> Since ubytes are pretty much the same as chars,

True from the point of view of sizes: they are both 8-bit wide. However, they are different beasts: char is merely a UTF-8 code unit. ubyte does not have such a meaning attached to it.

> I think writing 0 to the
> file will actually write the null character, which probably isn't a good
> thing.

I don't see any problem there. rawWrite() should just write 0.

I think Carl should provide a short program that demonstrates the problem. :)

Ali

Reply via email to