slicebuf

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer buffer

Example
buffer := New(10)
buf := buffer.Require(4)
buf[0] = 1
buf[1] = 2
buf[2] = 3
buf[3] = 4
fmt.Println(buffer.Bytes())
Output:
[1 2 3 4]

func New

func New(cap int) *Buffer

New create a clice buffer

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Require

func (b *Buffer) Require(n int) []byte

func (*Buffer) Reset

func (b *Buffer) Reset()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL