IPAddress.TryWriteBytes(Span<Byte>, Int32) Method

Definition

Tries to write the current IP address into a span of bytes in network order.

C#
public bool TryWriteBytes(Span<byte> destination, out int bytesWritten);

Parameters

destination
Span<Byte>

When this method returns, the IP address as a span of bytes.

bytesWritten
Int32

When this method returns, the number of bytes written into the span.

Returns

true if the IP address is successfully written to the given span; otherwise, false.

Applies to

Produkt Verzie
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1