awtk/tests/fscripts/demo_wbuffer1.fs
2022-08-23 11:21:48 +08:00

15 lines
347 B
GLSL

var a = wbuffer_create ()
wbuffer_write_binary(a, "wolrd", 6)
assert(wbuffer_get_cursor(a), 6)
var b = rbuffer_create(wbuffer_get_data(a), wbuffer_get_cursor(a))
var c = rbuffer_read_binary(b, 6)
assert(rbuffer_get_cursor(b), 6)
wbuffer_rewind(a)
assert(wbuffer_get_cursor(a) == 0)
wbuffer_write_binary(a, c)
assert(wbuffer_get_cursor(a)== 6)