helper

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString 没有内存开销的转换

func IsExist

func IsExist(path string) bool

IsExist 文件/路径存在

func IsNotExist

func IsNotExist(path string) bool

IsNotExist 文件/路径不存在

func NewWriterF

func NewWriterF(f func(writer *Writer)) []byte

func OpenWriterF

func OpenWriterF(f func(*Writer)) (b []byte, cl func())

OpenWriterF must call func cl to close

func PutWriter

func PutWriter(w *Writer)

PutWriter 将 Writer 放回池中

func StringToBytes

func StringToBytes(s string) (b []byte)

StringToBytes 没有内存开销的转换

Types

type Writer

type Writer bytes.Buffer

Writer 写入

func SelectWriter

func SelectWriter() *Writer

SelectWriter 从池中取出一个 Writer

func (*Writer) Bytes

func (w *Writer) Bytes() []byte

func (*Writer) FillUInt16

func (w *Writer) FillUInt16() (pos int)

func (*Writer) FillUInt32

func (w *Writer) FillUInt32() (pos int)

func (*Writer) Grow

func (w *Writer) Grow(n int)

func (*Writer) Len

func (w *Writer) Len() int

func (*Writer) Reset

func (w *Writer) Reset()

func (*Writer) Skip added in v0.8.3

func (w *Writer) Skip(n int) (int, error)

func (*Writer) Write

func (w *Writer) Write(b []byte) (n int, err error)

func (*Writer) WriteBool

func (w *Writer) WriteBool(b bool)

func (*Writer) WriteByte

func (w *Writer) WriteByte(b byte) error

func (*Writer) WriteBytesShort

func (w *Writer) WriteBytesShort(data []byte)

func (*Writer) WriteHex

func (w *Writer) WriteHex(h string)

func (*Writer) WriteString

func (w *Writer) WriteString(v string)

func (*Writer) WriteStringShort

func (w *Writer) WriteStringShort(v string)

func (*Writer) WriteUInt16

func (w *Writer) WriteUInt16(v uint16)

func (*Writer) WriteUInt16At

func (w *Writer) WriteUInt16At(pos int, v uint16)

func (*Writer) WriteUInt32

func (w *Writer) WriteUInt32(v uint32)

func (*Writer) WriteUInt32At

func (w *Writer) WriteUInt32At(pos int, v uint32)

func (*Writer) WriteUInt64

func (w *Writer) WriteUInt64(v uint64)

Jump to

Keyboard shortcuts

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