Esempio n. 1
0
        private byte[] GetBytesForArrayPrefix(int arrayLength)
        {
            var arrayProperty = (PlyArrayProperty)_iterator.CurrentProperty;
            var type          = arrayProperty.ArraySizeType;

            EnsureValueFitsType(arrayLength, type);
            byte[] countAsBytes = PlyTypeConverter.ToBytes(arrayLength, type);

            return(countAsBytes.FlipIfTrue(_reverseByteOrder));
        }
Esempio n. 2
0
        private byte[] GetBytes <T>(T value) where T : IConvertible
        {
            var valueAsBytes = PlyTypeConverter.ToBytes(value, _iterator.CurrentProperty.ValueType);

            return(valueAsBytes.FlipIfTrue(_reverseByteOrder));
        }