public static int AsVarShort(this ReadOnlySpan <byte> span, out ReadOnlySpan <byte> outSpan) { int result = VarShort.Read(span, out int offset); outSpan = span.Slice(offset); return(result); }
public static int ReadVarShort(List <byte> cache, int offset, out int count, bool readOnly = false) { int result = VarShort.Read(cache, offset, out int length); count = length + offset; if (!readOnly) { cache.RemoveRange(offset, length); } return(result); }
public static ReadOnlySpan <byte> ReadVarShort(this ReadOnlySpan <byte> span, out int varShort) { varShort = VarShort.Read(span, out int offset); return(span.Slice(offset)); }
public static int AsVarShort(this ReadOnlySpan <byte> span) => VarShort.Read(span);
public virtual int ReadVarShort() { return(VarShort.Read(this)); }