All Projects → smallnest → Ringbuffer

smallnest / Ringbuffer

Licence: mit
a thread-safe circular buffer (ring buffer) in Go, implemented io.ReaderWriter interface

Programming Languages

go
31211 projects - #10 most used programming language

ringbuffer

License GoDoc travis Go Report Card coveralls

A circular buffer (ring buffer) in Go, implemented io.ReaderWriter interface

wikipedia

	rb := New(1024)

	// write
	rb.Write([]byte("abcd"))
	fmt.Println(rb.Length())
	fmt.Println(rb.Free())

	// read
	buf := make([]byte, 4)
	rb.Read(buf)
	fmt.Println(string(buf))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].