packet

package
v0.0.0-...-fb597f4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2014 License: GPL-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Binary reader/writer. Helpers to read and write to packet. This binary parser is needed since we need to communicate with some legacy services. For some reason this services use LittleEndian :(

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

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

func Reader

func Reader(buffer []byte) *Packet

Instanciates a new buffer and its reader funcs

func Writer

func Writer(length int) *Packet

Instanciates a new buffer and its writer funcs

func (*Packet) Buffer

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

func (*Packet) ReadInt16

func (p *Packet) ReadInt16(offset int16) int16

func (*Packet) ReadInt32

func (p *Packet) ReadInt32(offset int16) int32

func (*Packet) ReadInt8

func (p *Packet) ReadInt8(offset int16) int8

func (*Packet) ReadString

func (p *Packet) ReadString(offset int16, length int16) string

func (*Packet) ReadUint16

func (p *Packet) ReadUint16(offset int16) uint16

func (*Packet) ReadUint32

func (p *Packet) ReadUint32(offset int16) uint32

func (*Packet) ReadUint8

func (p *Packet) ReadUint8(offset int16) uint8

func (*Packet) WriteInt16

func (p *Packet) WriteInt16(offset int16, payload int16)

func (*Packet) WriteInt32

func (p *Packet) WriteInt32(offset int16, payload int32)

func (*Packet) WriteInt8

func (p *Packet) WriteInt8(offset int16, payload int8)

func (*Packet) WriteString

func (p *Packet) WriteString(offset int16, payload string, length int16)

func (*Packet) WriteUint16

func (p *Packet) WriteUint16(offset int16, payload uint16)

func (*Packet) WriteUint32

func (p *Packet) WriteUint32(offset int16, payload uint32)

func (*Packet) WriteUint8

func (p *Packet) WriteUint8(offset int16, payload uint8)

Jump to

Keyboard shortcuts

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