internal void Rent()
 {
     this._memoryStream    = _memoryStreamPool.Rent();
     this._shortConverter  = _shortConverterPool.Rent();
     this._ushortConverter = _ushortConverterPool.Rent();
     this._intConverter    = _intConverterPool.Rent();
     this._uintConverter   = _uintConverterPool.Rent();
     this._longConverter   = _longConverterPool.Rent();
     this._ulongConverter  = _ulongConverterPool.Rent();
     this._floatConverter  = _floatConverterPool.Rent();
     this._doubleConverter = _doubleConverterPool.Rent();
     this._boolBuffer      = _boolBufferPool.Rent();
 }
Пример #2
0
        public void TestEndianess()
        {
            Console.WriteLine($"Is Little Endian: {BitConverter.IsLittleEndian}");

            int value = 15395;

            byte[] bigEndianBytes = BitConverter.GetBytes(value);

            IntByteArrayConverter converter = new IntByteArrayConverter {
                array = bigEndianBytes
            };

            Assert.AreEqual(value, converter.value);
        }