rw

package
v0.0.0-...-d3bc976 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZeroBytes = make([]byte, 1024)

Functions

func CloseRead

func CloseRead(reader any) error

func CloseWrite

func CloseWrite(writer any) error

func FileExists

func FileExists(path string) bool

func ReadByte

func ReadByte(reader io.Reader) (byte, error)

func ReadBytes

func ReadBytes(reader io.Reader, size int) ([]byte, error)

func ReadJSON

func ReadJSON(path string, data any) error

func ReadString

func ReadString(reader io.Reader, size int) (string, error)

func ReadUVariant

func ReadUVariant(reader io.Reader) (uint64, error)

func ReadVString

func ReadVString(reader io.Reader) (string, error)

func Skip

func Skip(reader io.Reader) error

func SkipN

func SkipN(reader io.Reader, size int) error

func ToByteReader

func ToByteReader(reader io.Reader) io.ByteReader

func WriteByte

func WriteByte(writer io.Writer, b byte) error

func WriteBytes

func WriteBytes(writer io.Writer, b []byte) error

func WriteFile

func WriteFile(path string, content []byte) error

func WriteJSON

func WriteJSON(path string, data any) error

func WriteString

func WriteString(writer io.Writer, str string) error

func WriteUVariant

func WriteUVariant(writer io.Writer, value uint64) error

func WriteV

func WriteV(fd uintptr, data [][]byte) (int, error)

func WriteVString

func WriteVString(writer io.Writer, value string) error

func WriteZero

func WriteZero(writer io.Writer) error

func WriteZeroN

func WriteZeroN(writer io.Writer, size int) error

Types

type ReadCloser

type ReadCloser interface {
	CloseRead() error
}

type ReadCounter

type ReadCounter struct {
	io.Reader
	// contains filtered or unexported fields
}

func (*ReadCounter) Count

func (r *ReadCounter) Count() int64

func (*ReadCounter) Read

func (r *ReadCounter) Read(p []byte) (n int, err error)

func (*ReadCounter) Reset

func (r *ReadCounter) Reset()

type WriteCloser

type WriteCloser interface {
	CloseWrite() error
}

Jump to

Keyboard shortcuts

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