Documentation ¶
Overview ¶
Package binary 数据处理
Index ¶
- func BytesToString(b []byte) string
- func GBK2UTF8(s []byte) ([]byte, error)
- func NewWriterF(f func(writer *Writer)) []byte
- func OpenWriterF(f func(*Writer)) (b []byte, cl func())
- func PutWriter(w *Writer)
- func StringToBytes(s string) (b []byte)
- func UTF82GBK(s []byte) ([]byte, error)
- type Writer
- func (w *Writer) Bytes() []byte
- func (w *Writer) FillUInt16() (pos int)
- func (w *Writer) FillUInt32() (pos int)
- func (w *Writer) Grow(n int)
- func (w *Writer) Len() int
- func (w *Writer) Reset()
- func (w *Writer) String() string
- func (w *Writer) Write(b []byte) (n int, err error)
- func (w *Writer) WriteBool(b bool)
- func (w *Writer) WriteByte(b byte) error
- func (w *Writer) WriteHex(h string)
- func (w *Writer) WriteString(v string)
- func (w *Writer) WriteUInt16(v uint16)
- func (w *Writer) WriteUInt16At(pos int, v uint16)
- func (w *Writer) WriteUInt16LE(v uint16)
- func (w *Writer) WriteUInt32(v uint32)
- func (w *Writer) WriteUInt32At(pos int, v uint32)
- func (w *Writer) WriteUInt32LE(v uint32)
- func (w *Writer) WriteUInt64(v uint64)
- func (w *Writer) WriteUInt64LE(v uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenWriterF ¶ added in v1.2.4
OpenWriterF must call func cl to close
func StringToBytes ¶ added in v1.2.5
StringToBytes 没有内存开销的转换
Types ¶
type Writer ¶ added in v1.2.4
Writer 写入
func (*Writer) WriteUInt16At ¶ added in v1.2.4
WriteUInt16At ...
func (*Writer) WriteUInt16LE ¶ added in v1.3.0
WriteUInt16LE ...
func (*Writer) WriteUInt32At ¶ added in v1.2.4
WriteUInt32At ...
func (*Writer) WriteUInt32LE ¶ added in v1.3.0
WriteUInt32LE ...
func (*Writer) WriteUInt64LE ¶ added in v1.3.0
WriteUInt64LE ...
Click to show internal directories.
Click to hide internal directories.