Closed giann closed 2 years ago
We use string as buffer just like Lua does. This is obvious when using os or io. We need to provide an easy way to write binary data as a string.
os
io
Buffer buffer = Buffer{}; buffer.writeNumber(12, type: NumberType.u8); buffer.writeBoolean(true); buffer.write("hello world"); buffer.readNumber(NumberType.u8); buffer.readBoolean(); buffer.read(11);
We use string as buffer just like Lua does. This is obvious when using
os
orio
. We need to provide an easy way to write binary data as a string.