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)); }
private byte[] GetBytes <T>(T value) where T : IConvertible { var valueAsBytes = PlyTypeConverter.ToBytes(value, _iterator.CurrentProperty.ValueType); return(valueAsBytes.FlipIfTrue(_reverseByteOrder)); }