prefixedio

package module
v0.0.0-...-ac7e091 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2015 License: MIT Imports: 3 Imported by: 1

README

prefixedio

Circle CI

Size-prefixed I/O in Go

Documentation

Index

Constants

View Source
const MaxLen = 1048576

MaxLen is the maximum length allowed

Variables

This section is empty.

Functions

func WriteBytes

func WriteBytes(w io.Writer, bytes []byte) (n int, err error)

WriteBytes writes the size of the bytes passed, then the bytes

Types

type Buffer

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

Buffer is a size-prefixed buffer

func (*Buffer) Bytes

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

Bytes returns the bytes from the buffer

func (*Buffer) ReadFrom

func (p *Buffer) ReadFrom(rd io.Reader) (n int64, err error)

ReadFrom reads the size prefix (s) from rd, then overwrites the buffer with s bytes from rd

Jump to

Keyboard shortcuts

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