package flatbuffers

import (
	
)

type (
	// A SOffsetT stores a signed offset into arbitrary data.
	SOffsetT int32
	// A UOffsetT stores an unsigned offset into vector data.
	UOffsetT uint32
	// A VOffsetT stores an unsigned offset in a vtable.
	VOffsetT uint16
)

const (
	// VtableMetadataFields is the count of metadata fields in each vtable.
	VtableMetadataFields = 2
)

// GetByte decodes a little-endian byte from a byte slice.
func ( []byte) byte {
	return byte(GetUint8())
}

// GetBool decodes a little-endian bool from a byte slice.
func ( []byte) bool {
	return [0] == 1
}

// GetUint8 decodes a little-endian uint8 from a byte slice.
func ( []byte) ( uint8) {
	 = uint8([0])
	return
}

// GetUint16 decodes a little-endian uint16 from a byte slice.
func ( []byte) ( uint16) {
	_ = [1] // Force one bounds check. See: golang.org/issue/14808
	 |= uint16([0])
	 |= uint16([1]) << 8
	return
}

// GetUint32 decodes a little-endian uint32 from a byte slice.
func ( []byte) ( uint32) {
	_ = [3] // Force one bounds check. See: golang.org/issue/14808
	 |= uint32([0])
	 |= uint32([1]) << 8
	 |= uint32([2]) << 16
	 |= uint32([3]) << 24
	return
}

// GetUint64 decodes a little-endian uint64 from a byte slice.
func ( []byte) ( uint64) {
	_ = [7] // Force one bounds check. See: golang.org/issue/14808
	 |= uint64([0])
	 |= uint64([1]) << 8
	 |= uint64([2]) << 16
	 |= uint64([3]) << 24
	 |= uint64([4]) << 32
	 |= uint64([5]) << 40
	 |= uint64([6]) << 48
	 |= uint64([7]) << 56
	return
}

// GetInt8 decodes a little-endian int8 from a byte slice.
func ( []byte) ( int8) {
	 = int8([0])
	return
}

// GetInt16 decodes a little-endian int16 from a byte slice.
func ( []byte) ( int16) {
	_ = [1] // Force one bounds check. See: golang.org/issue/14808
	 |= int16([0])
	 |= int16([1]) << 8
	return
}

// GetInt32 decodes a little-endian int32 from a byte slice.
func ( []byte) ( int32) {
	_ = [3] // Force one bounds check. See: golang.org/issue/14808
	 |= int32([0])
	 |= int32([1]) << 8
	 |= int32([2]) << 16
	 |= int32([3]) << 24
	return
}

// GetInt64 decodes a little-endian int64 from a byte slice.
func ( []byte) ( int64) {
	_ = [7] // Force one bounds check. See: golang.org/issue/14808
	 |= int64([0])
	 |= int64([1]) << 8
	 |= int64([2]) << 16
	 |= int64([3]) << 24
	 |= int64([4]) << 32
	 |= int64([5]) << 40
	 |= int64([6]) << 48
	 |= int64([7]) << 56
	return
}

// GetFloat32 decodes a little-endian float32 from a byte slice.
func ( []byte) float32 {
	 := GetUint32()
	return math.Float32frombits()
}

// GetFloat64 decodes a little-endian float64 from a byte slice.
func ( []byte) float64 {
	 := GetUint64()
	return math.Float64frombits()
}

// GetUOffsetT decodes a little-endian UOffsetT from a byte slice.
func ( []byte) UOffsetT {
	return UOffsetT(GetUint32())
}

// GetSOffsetT decodes a little-endian SOffsetT from a byte slice.
func ( []byte) SOffsetT {
	return SOffsetT(GetInt32())
}

// GetVOffsetT decodes a little-endian VOffsetT from a byte slice.
func ( []byte) VOffsetT {
	return VOffsetT(GetUint16())
}

// WriteByte encodes a little-endian uint8 into a byte slice.
func ( []byte,  byte) {
	WriteUint8(, uint8())
}

// WriteBool encodes a little-endian bool into a byte slice.
func ( []byte,  bool) {
	[0] = 0
	if  {
		[0] = 1
	}
}

// WriteUint8 encodes a little-endian uint8 into a byte slice.
func ( []byte,  uint8) {
	[0] = byte()
}

// WriteUint16 encodes a little-endian uint16 into a byte slice.
func ( []byte,  uint16) {
	_ = [1] // Force one bounds check. See: golang.org/issue/14808
	[0] = byte()
	[1] = byte( >> 8)
}

// WriteUint32 encodes a little-endian uint32 into a byte slice.
func ( []byte,  uint32) {
	_ = [3] // Force one bounds check. See: golang.org/issue/14808
	[0] = byte()
	[1] = byte( >> 8)
	[2] = byte( >> 16)
	[3] = byte( >> 24)
}

// WriteUint64 encodes a little-endian uint64 into a byte slice.
func ( []byte,  uint64) {
	_ = [7] // Force one bounds check. See: golang.org/issue/14808
	[0] = byte()
	[1] = byte( >> 8)
	[2] = byte( >> 16)
	[3] = byte( >> 24)
	[4] = byte( >> 32)
	[5] = byte( >> 40)
	[6] = byte( >> 48)
	[7] = byte( >> 56)
}

// WriteInt8 encodes a little-endian int8 into a byte slice.
func ( []byte,  int8) {
	[0] = byte()
}

// WriteInt16 encodes a little-endian int16 into a byte slice.
func ( []byte,  int16) {
	_ = [1] // Force one bounds check. See: golang.org/issue/14808
	[0] = byte()
	[1] = byte( >> 8)
}

// WriteInt32 encodes a little-endian int32 into a byte slice.
func ( []byte,  int32) {
	_ = [3] // Force one bounds check. See: golang.org/issue/14808
	[0] = byte()
	[1] = byte( >> 8)
	[2] = byte( >> 16)
	[3] = byte( >> 24)
}

// WriteInt64 encodes a little-endian int64 into a byte slice.
func ( []byte,  int64) {
	_ = [7] // Force one bounds check. See: golang.org/issue/14808
	[0] = byte()
	[1] = byte( >> 8)
	[2] = byte( >> 16)
	[3] = byte( >> 24)
	[4] = byte( >> 32)
	[5] = byte( >> 40)
	[6] = byte( >> 48)
	[7] = byte( >> 56)
}

// WriteFloat32 encodes a little-endian float32 into a byte slice.
func ( []byte,  float32) {
	WriteUint32(, math.Float32bits())
}

// WriteFloat64 encodes a little-endian float64 into a byte slice.
func ( []byte,  float64) {
	WriteUint64(, math.Float64bits())
}

// WriteVOffsetT encodes a little-endian VOffsetT into a byte slice.
func ( []byte,  VOffsetT) {
	WriteUint16(, uint16())
}

// WriteSOffsetT encodes a little-endian SOffsetT into a byte slice.
func ( []byte,  SOffsetT) {
	WriteInt32(, int32())
}

// WriteUOffsetT encodes a little-endian UOffsetT into a byte slice.
func ( []byte,  UOffsetT) {
	WriteUint32(, uint32())
}