Documentation
¶
Index ¶
- func ReadBytes(in *[]byte, n int) []byte
- func ReadUint16(in *[]byte) (uint16, bool)
- func ReadUint24(in *[]byte) (uint32, bool)
- func ReadUint32(in *[]byte) (uint32, bool)
- func ReadUint8(in *[]byte) (uint8, bool)
- func Skip(in *[]byte, n int) bool
- func WriteBytes(in *[]byte, bytes ...byte)
- func WriteUint16(in *[]byte, v uint16)
- func WriteUint24(in *[]byte, v uint32)
- func WriteUint32(in *[]byte, v uint32)
- func WriteUint8(in *[]byte, v uint8)
- type Buffer
- func (b *Buffer) Bytes() []byte
- func (b *Buffer) BytesPointer() *[]byte
- func (b *Buffer) Empty() bool
- func (b *Buffer) ReadBytes(n int) []byte
- func (b *Buffer) ReadUint16() (uint16, bool)
- func (b *Buffer) ReadUint24() (uint32, bool)
- func (b *Buffer) ReadUint32() (uint32, bool)
- func (b *Buffer) ReadUint8() (uint8, bool)
- func (b *Buffer) Size() int
- func (b *Buffer) Skip(n int) bool
- func (b *Buffer) WriteBytes(bytes ...byte)
- func (b *Buffer) WriteUint16(v uint16)
- func (b *Buffer) WriteUint24(v uint32)
- func (b *Buffer) WriteUint32(v uint32)
- func (b *Buffer) WriteUint8(v uint8)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadBytes ¶
ReadBytes removes the first n bytes from in and returns it. If the read failed, returns nil.
func ReadUint16 ¶
ReadUint16 removes the first bytes from in and returns it as an uint16. The bool indicates whether the read was successful.
func ReadUint24 ¶
ReadUint24 removes the first bytes from in and returns it as a uint32. The bool indicates whether the read was successful.
func ReadUint32 ¶
ReadUint32 removes the first bytes from in and returns it as an uint32. The bool indicates whether the read was successful.
func ReadUint8 ¶
ReadUint8 removes the first byte from in and returns it as an uint8. The bool indicates whether the read was successful.
func WriteBytes ¶
WriteBytes appends bytes at the end of in.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) BytesPointer ¶
BytesPointer returns a pointer to the underlying byte slice.
func (*Buffer) ReadBytes ¶
ReadBytes removes the first n bytes from b and returns it. If the read failed, returns nil.
func (*Buffer) ReadUint16 ¶
ReadUint16 removes the first bytes from b and returns it as an uint16. The bool indicates whether the read was successful.
func (*Buffer) ReadUint24 ¶
ReadUint24 removes the first bytes from b and returns it as a uint32. The bool indicates whether the read was successful.
func (*Buffer) ReadUint32 ¶
ReadUint32 removes the first bytes from b and returns it as an uint32. The bool indicates whether the read was successful.
func (*Buffer) ReadUint8 ¶
ReadUint8 removes the first byte from b and returns it as an uint8. The bool indicates whether the read was successful.
func (*Buffer) WriteBytes ¶
WriteBytes appends bytes at the end of b.
func (*Buffer) WriteUint16 ¶
WriteUint16 appends v at the end of b.
func (*Buffer) WriteUint24 ¶
WriteUint24 appends v at the end of b.
func (*Buffer) WriteUint32 ¶
WriteUint32 appends v at the end of b.
func (*Buffer) WriteUint8 ¶
WriteUint8 appends v at the end of b.