Exemplo n.º 1
0
        public BinaryBuilder(ISizing sizing, IMemoryPolicy policy = default,
                             Endianness endianness = Endianness.LittleEndian)
        {
            _policy = policy ?? new HeapAllocationPolicy();
            _sizing = sizing;

            if (PrimitiveBinaryCacheBuilder.IsAlreadySet)
            {
                return;
            }

            if (endianness == Endianness.LittleEndian)
            {
                PrimitiveBinaryCacheBuilder.RegisterAllLittleEndian();
            }
            else
            {
                PrimitiveBinaryCacheBuilder.RegisterAllBigEndian();
            }
        }
Exemplo n.º 2
0
 internal BinaryFactory(IMemoryPolicy policy, ISizing sizing)
 {
     _policy = policy;
     _sizing = sizing;
 }
Exemplo n.º 3
0
 internal MemoryWriter(IMemoryOwner <byte> buffer, ISizing sizing, int size) : base(size)
 {
     _sizing      = sizing;
     _bufferOwner = buffer;
 }