public static bool TryCreate(ReadOnlyMemory <byte> utf8Bytes, out Utf8Memory utf8Memory) { if (!Utf8Span.TryParseUtf8Bytes(utf8Bytes.Span, out _)) { utf8Memory = default; return(false); } utf8Memory = new Utf8Memory(utf8Bytes); return(true); }
public static bool TryCreate(ReadOnlyMemory <byte> utf8Bytes, out Utf8Memory utf8Memory) { if (!Utf8Span.TryParseUtf8Bytes(utf8Bytes.Span, out _)) { utf8Memory = default; return(false); } utf8Memory = new Utf8Memory(utf8Bytes); return(true); }