Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static ReadOnlySpan <byte> ReadVarShort(this ReadOnlySpan <byte> span, out int varShort)
 {
     varShort = VarShort.Read(span, out int offset);
     return(span.Slice(offset));
 }
Exemplo n.º 4
0
 public static int AsVarShort(this ReadOnlySpan <byte> span) => VarShort.Read(span);
Exemplo n.º 5
0
 public virtual int ReadVarShort()
 {
     return(VarShort.Read(this));
 }