/tiny_ring_bufio

tiny_ring_bufio implement ringed buffer I/O , wrap an io.Reader or io.Writeer object and buffer ringed byte slice

Primary LanguageGo

tiny_ring_bufio wercker status

This pcakge provide Ring Buffer I/O wrap an io>Reader/io.Writer object and buffer ringed byte slice

sequence is read/check(parse)/write .

example

file, _ := os.Open("test")
bufio := tiny_ring_bufio.New(1024, 30)
file_n, e := bufio.ReadAtLeast(file, 20) // read over 20byte

data := bufio.Check(bufio.UnCheckedSeqLen()) // get data as []byte

fmt.Println("dump bufio withouf buffer data", bufio.p())

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kazu/tiny_ring_bufio