BinarySerializerTrySerializeValueTypeT(T, Byte) Method
Tries to serialize the specified
value into a byte array.
The operation will succeed if
T does not contain any references.
See the
Remarks section of the
SerializeValueTypeT(T) method for details.
Namespace: KGySoft.Serialization.BinaryAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public static bool TrySerializeValueType<T>(
in T value,
out byte[] result
)
where T : struct, new()
Public Shared Function TrySerializeValueType(Of T As {Structure, New}) (
ByRef value As T,
<OutAttribute> ByRef result As Byte()
) As Boolean
public:
generic<typename T>
where T : value class, gcnew()
static bool TrySerializeValueType(
[InAttribute] T% value,
[OutAttribute] array<unsigned char>^% result
)
static member TrySerializeValueType :
value : 'T byref *
result : byte[] byref -> bool when 'T : struct, new()
- value T
- The value to serialize.
- result Byte
- When this method returns, the byte array representation of the specified value. This parameter is passed uninitialized.
- T
- The type of the object to serialize.
Boolean, if
T contains no references and could be serialized; otherwise,
.