Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

buffer-op

a toolset of how to handle buffer

example

letlib=require("buffer-op")letstream=newlib.Stream(64)letwriter=newlib.Writer(stream)letreader=newlib.Reader(stream){writer.append_int8(-10)writer.append_uint8(10)writer.append_int32(-1000)writer.append_uint32(1000)writer.append_string("this is a test")writer.append_double(10.4)}{letanother=newlib.Stream()letanother_writer=newlib.Writer(another)for(leti=0,len=20;i<len;++i){another_writer.append_string("this is gonna be a huge thing")another_writer.append_int32(-323)}writer.append_bytes(another)}{console.log(reader.read_int8())console.log(reader.read_uint8())console.log(reader.read_int32())console.log(reader.read_uint32())console.log(reader.read_string())console.log(reader.read_double())}{console.log("----------------------------")letbuffer=reader.read_bytes()letanother=newlib.Stream(buffer)letanother_reader=newlib.Reader(another)for(leti=0,len=20;i<len;++i){console.log(another_reader.read_string())console.log(another_reader.read_int32())}console.log(another_reader.left_size())}

About

a toolset of how to handle buffer

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages