BinarySerializerSerializeValueArrayT Method
Namespace: KGySoft.Serialization.BinaryAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
[SecurityCriticalAttribute]
public static byte[] SerializeValueArray<T>(
T[] array
)
where T : struct, new()
<SecurityCriticalAttribute>
Public Shared Function SerializeValueArray(Of T As {Structure, New}) (
array As T()
) As Byte()
public:
[SecurityCriticalAttribute]
generic<typename T>
where T : value class, gcnew()
static array<unsigned char>^ SerializeValueArray(
array<T>^ array
)
[<SecurityCriticalAttribute>]
static member SerializeValueArray :
array : 'T[] -> byte[] when 'T : struct, new()
- array T
- The array to serialize.
- T
- Element type of the array. Must be a ValueType that has no references.
ByteThe byte array representation of the
array.
Do not use this method with
T types that have references.
When using this library with a compiler that recognizes the
unmanaged constraint,
then this is enforced for direct calls; however, by using reflection
T can be any value type.
For performance reasons this method does not check if
T has references,
but you can call the
TrySerializeValueArrayT(T, Byte) method that performs the check.