func (s *Serializer) Write64BytesArraySlice(data SliceOfArraysOf64Bytes, deSeriMode DeSerializationMode, lenType SeriLengthPrefixType, arrayRules *ArrayRules, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	sliceLength := len(data)
	var arrayElementValidator ElementValidationFunc
	if arrayRules != nil && deSeriMode.HasMode(DeSeriModePerformValidation) {
		if err := arrayRules.CheckBounds(uint(sliceLength)); err != nil {
			s.err = errProducer(err)
			return s
		}
		arrayElementValidator = arrayRules.ElementValidationFunc(arrayRules.ValidationMode)
	}
	_ = s.writeSliceLength(sliceLength, lenType, errProducer)
	if s.err != nil {
		return s
	}
	for i := range data {
		element := data[i][:]
		if arrayElementValidator != nil {
			if err := arrayElementValidator(i, element); err != nil {
				s.err = errProducer(err)
				return s
			}
		}
		if _, err := s.buf.Write(element); err != nil {
			s.err = errProducer(err)
			return s
		}
	}
	return s
}
Write64BytesArraySlice writes a slice of arrays of 64 bytes to the Serializer.
package serializer
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"math"
	"time"
)
type (
	ArrayOf32Bytes = [32]byte
	ArrayOf64Bytes = [64]byte
	ArrayOf49Bytes = [49]byte
	SliceOfArraysOf32Bytes = []ArrayOf32Bytes
	SliceOfArraysOf64Bytes = []ArrayOf64Bytes
	ErrProducer func(err error) error
	ErrProducerWithLeftOver func(left int, err error) error
	WrittenObjectConsumer func(index int, written []byte) error
	ReadObjectConsumerFunc func(seri Serializable)
	ReadObjectsConsumerFunc func(seri Serializables)
)
type SeriLengthPrefixType byte
const (
	SeriLengthPrefixTypeAsByte SeriLengthPrefixType = iota
	SeriLengthPrefixTypeAsUint16
	SeriLengthPrefixTypeAsUint32
)
func NewSerializer() *Serializer {
	return &Serializer{}
}
type Serializer struct {
	buf bytes.Buffer
	err error
}
func (s *Serializer) Serialize() ([]byte, error) {
	if s.err != nil {
		return nil, s.err
	}
	return s.buf.Bytes(), nil
}
func (s *Serializer) AbortIf(errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	if err := errProducer(nil); err != nil {
		s.err = err
	}
	return s
}
func (s *Serializer) Do(f func()) *Serializer {
	if s.err != nil {
		return s
	}
	f()
	return s
}
func (s *Serializer) Written() int {
	return s.buf.Len()
}
func (s *Serializer) WriteNum(v interface{}, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	if err := binary.Write(&s.buf, binary.LittleEndian, v); err != nil {
		s.err = errProducer(err)
	}
	return s
}
func (s *Serializer) WriteBool(v bool, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	var val byte
	if v {
		val = 1
	}
	if err := s.buf.WriteByte(val); err != nil {
		s.err = errProducer(err)
	}
	return s
}
func (s *Serializer) WriteByte(data byte, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	if err := s.buf.WriteByte(data); err != nil {
		s.err = errProducer(err)
	}
	return s
}
func (s *Serializer) WriteBytes(data []byte, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	if _, err := s.buf.Write(data); err != nil {
		s.err = errProducer(err)
	}
	return s
}
func (s *Serializer) writeSliceLength(l int, lenType SeriLengthPrefixType, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	switch lenType {
	case SeriLengthPrefixTypeAsByte:
		if l > math.MaxUint8 {
			s.err = errProducer(fmt.Errorf("unable to serialize collection length: length %d is out of range (0-%d)", l, math.MaxUint8))
			return s
		}
		if err := s.buf.WriteByte(byte(l)); err != nil {
			s.err = errProducer(err)
			return s
		}
	case SeriLengthPrefixTypeAsUint16:
		if l > math.MaxUint16 {
			s.err = errProducer(fmt.Errorf("unable to serialize collection length: length %d is out of range (0-%d)", l, math.MaxUint16))
			return s
		}
		if err := binary.Write(&s.buf, binary.LittleEndian, uint16(l)); err != nil {
			s.err = errProducer(err)
			return s
		}
	case SeriLengthPrefixTypeAsUint32:
		if l > math.MaxUint32 {
			s.err = errProducer(fmt.Errorf("unable to serialize collection length: length %d is out of range (0-%d)", l, math.MaxUint32))
			return s
		}
		if err := binary.Write(&s.buf, binary.LittleEndian, uint32(l)); err != nil {
			s.err = errProducer(err)
			return s
		}
	default:
		panic(fmt.Sprintf("unknown slice length type %v", lenType))
	}
	return s
}
func (s *Serializer) WriteVariableByteSlice(data []byte, lenType SeriLengthPrefixType, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	_ = s.writeSliceLength(len(data), lenType, errProducer)
	if s.err != nil {
		return s
	}
	if _, err := s.buf.Write(data); err != nil {
		s.err = errProducer(err)
		return s
	}
	return s
}
func (s *Serializer) Write32BytesArraySlice(data SliceOfArraysOf32Bytes, deSeriMode DeSerializationMode, lenType SeriLengthPrefixType, arrayRules *ArrayRules, errProducer ErrProducer) *Serializer {
	if s.err != nil {
		return s
	}
	sliceLength := len(data)
	var arrayElementValidator ElementValidationFunc
	if arrayRules != nil && deSeriMode.HasMode(DeSeriModePerformValidation) {
		if err := arrayRules.CheckBounds(uint(sliceLength)); err != nil {
			s.err = errProducer(err)
			return s
		}
		arrayElementValidator = arrayRules.ElementValidationFunc(arrayRules.ValidationMode)
	}
	_ = s.writeSliceLength(sliceLength, lenType, errProducer)
	if s.err != nil {
		return s
	}
	for i := range data {
		element := data[i][:]
		if arrayElementValidator != nil {
			if err := arrayElementValidator(i, element); err != nil {
				s.err = errProducer(err)
				return s
			}
		}
		if _, err := s.buf.Write(element); err != nil {
			s.err = errProducer(err)
			return s
		}
	}
	return s
}