bytec

package
v0.0.0-...-f5c3557 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package bytec implements some bytes utilities.

"bytec" is pronounced "bytes".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dup

func Dup(b []byte) []byte

Dup makes a copy of the given byte slice

func MultiReader

func MultiReader(bs ...[]byte) io.Reader

MultiReader returns a Reader that's the logical concatenation of the provided input byte slice.

func Put

func Put(s **S)

Put returns the slice to the pool and sets S to nil.

Types

type S

type S []byte

S is a []byte. Any existing []byte may be cast to an S and added to the pool.

func Make

func Make(n uint64) (s *S)

Make gets an appropriately-sized S from the pool. When you're done, be sure to call Put() on the S to add it back to the pool.

When you request a buffer, the only guarauntee is that you will get a []byte _at least_ as large as the requested size, though likely larger.

Jump to

Keyboard shortcuts

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