public static long AsVarLong(this ReadOnlySpan <byte> span, out ReadOnlySpan <byte> outSpan) { long result = VarLong.Read(span, out int offset); outSpan = span.Slice(offset); return(result); }
public static long ReadVarLong(List <byte> cache, int offset, out int count, bool readOnly = false) { long result = VarLong.Read(cache, offset, out int length); count = length + offset; if (!readOnly) { cache.RemoveRange(offset, length); } return(result); }
public static ReadOnlySpan <byte> ReadVarLong(this ReadOnlySpan <byte> span, out long varLong) { varLong = VarLong.Read(span, out int offset); return(span.Slice(offset)); }
public static long AsVarLong(this ReadOnlySpan <byte> span) => VarLong.Read(span);
public void Write(VarLong value, bool prepend = false) { writeVarLong(value, prepend); }
public virtual void WriteVarLong(long value) { WriteBytes(VarLong.GetBytes(value)); }
public virtual long ReadVarLong() { return(VarLong.Read(this)); }