Documentation ¶
Overview ¶
Package binutils implements easy and simple reading and writing of byte arrays. It writes and reads directly to and from byte arrays, rather than readers.
Index ¶
- func Read(buffer *[]byte, offset *int, length int) []byte
- func ReadBigTriad(buffer *[]byte, offset *int) uint32
- func ReadBool(buffer *[]byte, offset *int) bool
- func ReadByte(buffer *[]byte, offset *int) byte
- func ReadDouble(buffer *[]byte, offset *int) float64
- func ReadFloat(buffer *[]byte, offset *int) float32
- func ReadInt(buffer *[]byte, offset *int) int32
- func ReadLittleDouble(buffer *[]byte, offset *int) float64
- func ReadLittleFloat(buffer *[]byte, offset *int) float32
- func ReadLittleInt(buffer *[]byte, offset *int) int32
- func ReadLittleLong(buffer *[]byte, offset *int) int64
- func ReadLittleShort(buffer *[]byte, offset *int) int16
- func ReadLittleTriad(buffer *[]byte, offset *int) uint32
- func ReadLittleUnsignedInt(buffer *[]byte, offset *int) uint32
- func ReadLittleUnsignedLong(buffer *[]byte, offset *int) uint64
- func ReadLittleUnsignedShort(buffer *[]byte, offset *int) uint16
- func ReadLong(buffer *[]byte, offset *int) int64
- func ReadShort(buffer *[]byte, offset *int) int16
- func ReadString(buffer *[]byte, offset *int) string
- func ReadUnsignedByte(buffer *[]byte, offset *int) byte
- func ReadUnsignedInt(buffer *[]byte, offset *int) uint32
- func ReadUnsignedLong(buffer *[]byte, offset *int) uint64
- func ReadUnsignedShort(buffer *[]byte, offset *int) uint16
- func ReadUnsignedVarInt(buffer *[]byte, offset *int) uint32
- func ReadUnsignedVarLong(buffer *[]byte, offset *int) uint64
- func ReadVarInt(buffer *[]byte, offset *int) int32
- func ReadVarLong(buffer *[]byte, offset *int) int64
- func Write(buffer *[]byte, v byte)
- func WriteBigTriad(buffer *[]byte, uint uint32)
- func WriteBool(buffer *[]byte, bool bool)
- func WriteByte(buffer *[]byte, byte byte)
- func WriteDouble(buffer *[]byte, double float64)
- func WriteFloat(buffer *[]byte, float float32)
- func WriteInt(buffer *[]byte, int int32)
- func WriteLittleDouble(buffer *[]byte, double float64)
- func WriteLittleFloat(buffer *[]byte, float float32)
- func WriteLittleInt(buffer *[]byte, int int32)
- func WriteLittleLong(buffer *[]byte, long int64)
- func WriteLittleShort(buffer *[]byte, signed int16)
- func WriteLittleTriad(buffer *[]byte, uint uint32)
- func WriteLittleUnsignedInt(buffer *[]byte, v uint32)
- func WriteLittleUnsignedLong(buffer *[]byte, v uint64)
- func WriteLittleUnsignedShort(buffer *[]byte, v uint16)
- func WriteLong(buffer *[]byte, long int64)
- func WriteShort(buffer *[]byte, signed int16)
- func WriteString(buffer *[]byte, str string)
- func WriteUnsignedByte(buffer *[]byte, unsigned uint8)
- func WriteUnsignedInt(buffer *[]byte, v uint32)
- func WriteUnsignedLong(buffer *[]byte, v uint64)
- func WriteUnsignedShort(buffer *[]byte, v uint16)
- func WriteUnsignedVarInt(buffer *[]byte, value uint32)
- func WriteUnsignedVarLong(buffer *[]byte, value uint64)
- func WriteVarInt(buffer *[]byte, value int32)
- func WriteVarLong(buffer *[]byte, value int64)
- type EndianType
- type Stream
- func (stream *Stream) Feof() bool
- func (stream *Stream) Get(length int) []byte
- func (stream *Stream) GetBool() bool
- func (stream *Stream) GetBuffer() []byte
- func (stream *Stream) GetByte() byte
- func (stream *Stream) GetDouble() float64
- func (stream *Stream) GetFloat() float32
- func (stream *Stream) GetInt() int32
- func (stream *Stream) GetLengthPrefixedBytes() []byte
- func (stream *Stream) GetLittleDouble() float64
- func (stream *Stream) GetLittleFloat() float32
- func (stream *Stream) GetLittleInt() int32
- func (stream *Stream) GetLittleLong() int64
- func (stream *Stream) GetLittleShort() int16
- func (stream *Stream) GetLittleTriad() uint32
- func (stream *Stream) GetLittleUnsignedInt() uint32
- func (stream *Stream) GetLittleUnsignedLong() uint64
- func (stream *Stream) GetLittleUnsignedShort() uint16
- func (stream *Stream) GetLong() int64
- func (stream *Stream) GetOffset() int
- func (stream *Stream) GetShort() int16
- func (stream *Stream) GetString() string
- func (stream *Stream) GetTriad() uint32
- func (stream *Stream) GetUnsignedByte() byte
- func (stream *Stream) GetUnsignedInt() uint32
- func (stream *Stream) GetUnsignedLong() uint64
- func (stream *Stream) GetUnsignedShort() uint16
- func (stream *Stream) GetUnsignedVarInt() uint32
- func (stream *Stream) GetUnsignedVarLong() uint64
- func (stream *Stream) GetVarInt() int32
- func (stream *Stream) GetVarLong() int64
- func (stream *Stream) PutBool(v bool)
- func (stream *Stream) PutByte(v byte)
- func (stream *Stream) PutBytes(bytes []byte)
- func (stream *Stream) PutDouble(v float64)
- func (stream *Stream) PutFloat(v float32)
- func (stream *Stream) PutInt(v int32)
- func (stream *Stream) PutLengthPrefixedBytes(bytes []byte)
- func (stream *Stream) PutLittleDouble(v float64)
- func (stream *Stream) PutLittleFloat(v float32)
- func (stream *Stream) PutLittleInt(v int32)
- func (stream *Stream) PutLittleLong(v int64)
- func (stream *Stream) PutLittleShort(v int16)
- func (stream *Stream) PutLittleTriad(v uint32)
- func (stream *Stream) PutLittleUnsignedInt(v uint32)
- func (stream *Stream) PutLittleUnsignedLong(v uint64)
- func (stream *Stream) PutLittleUnsignedShort(v uint16)
- func (stream *Stream) PutLong(v int64)
- func (stream *Stream) PutShort(v int16)
- func (stream *Stream) PutString(v string)
- func (stream *Stream) PutTriad(v uint32)
- func (stream *Stream) PutUnsignedByte(v byte)
- func (stream *Stream) PutUnsignedInt(v uint32)
- func (stream *Stream) PutUnsignedLong(v uint64)
- func (stream *Stream) PutUnsignedShort(v uint16)
- func (stream *Stream) PutUnsignedVarInt(v uint32)
- func (stream *Stream) PutUnsignedVarLong(v uint64)
- func (stream *Stream) PutVarInt(v int32)
- func (stream *Stream) PutVarLong(v int64)
- func (stream *Stream) ResetStream()
- func (stream *Stream) SetBuffer(buffer []byte)
- func (stream *Stream) SetOffset(offset int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadBigTriad ¶
func ReadDouble ¶
func ReadLittleDouble ¶
func ReadLittleFloat ¶
func ReadLittleInt ¶
func ReadLittleLong ¶
func ReadLittleShort ¶
func ReadLittleTriad ¶
func ReadLittleUnsignedInt ¶
func ReadLittleUnsignedLong ¶
func ReadLittleUnsignedShort ¶
func ReadString ¶
func ReadUnsignedByte ¶
func ReadUnsignedInt ¶
func ReadUnsignedLong ¶
func ReadUnsignedShort ¶
func ReadUnsignedVarInt ¶
func ReadUnsignedVarLong ¶
func ReadVarInt ¶
func ReadVarLong ¶
func WriteBigTriad ¶
func WriteDouble ¶
func WriteFloat ¶
func WriteLittleDouble ¶
func WriteLittleFloat ¶
func WriteLittleInt ¶
func WriteLittleLong ¶
func WriteLittleShort ¶
func WriteLittleTriad ¶
func WriteLittleUnsignedInt ¶
func WriteLittleUnsignedLong ¶
func WriteShort ¶
func WriteString ¶
func WriteUnsignedByte ¶
func WriteUnsignedInt ¶
func WriteUnsignedLong ¶
func WriteUnsignedShort ¶
func WriteUnsignedVarInt ¶
func WriteUnsignedVarLong ¶
func WriteVarInt ¶
func WriteVarLong ¶
Types ¶
type Stream ¶
Stream is a container of a byte array and an offset. Reading from the stream increments the offset.
func (*Stream) Get ¶
Get reads the given amount of bytes from the buffer. If length is negative, reads the leftover bytes.
func (*Stream) GetLengthPrefixedBytes ¶
func (*Stream) GetLittleDouble ¶
func (*Stream) GetLittleFloat ¶
func (*Stream) GetLittleInt ¶
func (*Stream) GetLittleLong ¶
func (*Stream) GetLittleShort ¶
func (*Stream) GetLittleTriad ¶
func (*Stream) GetLittleUnsignedInt ¶
func (*Stream) GetLittleUnsignedLong ¶
func (*Stream) GetLittleUnsignedShort ¶
func (*Stream) GetUnsignedByte ¶
func (*Stream) GetUnsignedInt ¶
func (*Stream) GetUnsignedLong ¶
func (*Stream) GetUnsignedShort ¶
func (*Stream) GetUnsignedVarInt ¶
func (*Stream) GetUnsignedVarLong ¶
func (*Stream) GetVarLong ¶
func (*Stream) PutLengthPrefixedBytes ¶
func (*Stream) PutLittleDouble ¶
func (*Stream) PutLittleFloat ¶
func (*Stream) PutLittleInt ¶
func (*Stream) PutLittleLong ¶
func (*Stream) PutLittleShort ¶
func (*Stream) PutLittleTriad ¶
func (*Stream) PutLittleUnsignedInt ¶
func (*Stream) PutLittleUnsignedLong ¶
func (*Stream) PutLittleUnsignedShort ¶
func (*Stream) PutUnsignedByte ¶
func (*Stream) PutUnsignedInt ¶
func (*Stream) PutUnsignedLong ¶
func (*Stream) PutUnsignedShort ¶
func (*Stream) PutUnsignedVarInt ¶
func (*Stream) PutUnsignedVarLong ¶
func (*Stream) PutVarLong ¶
func (*Stream) ResetStream ¶
func (stream *Stream) ResetStream()
Click to show internal directories.
Click to hide internal directories.