Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public static ReadOnlySpan <byte> ReadVarLong(this ReadOnlySpan <byte> span, out long varLong)
 {
     varLong = VarLong.Read(span, out int offset);
     return(span.Slice(offset));
 }
Beispiel #4
0
 public static long AsVarLong(this ReadOnlySpan <byte> span) => VarLong.Read(span);
Beispiel #5
0
 public void Write(VarLong value, bool prepend = false)
 {
     writeVarLong(value, prepend);
 }
Beispiel #6
0
 public virtual void WriteVarLong(long value)
 {
     WriteBytes(VarLong.GetBytes(value));
 }
Beispiel #7
0
 public virtual long ReadVarLong()
 {
     return(VarLong.Read(this));
 }