Ejemplo n.º 1
0
        protected internal override Span <byte> _GetSpan(int index, int count)
        {
            if (0u >= (uint)count)
            {
                return(Span <byte> .Empty);
            }

            switch (_componentCount)
            {
            case 0:
                return(Span <byte> .Empty);

            case 1:
                ComponentEntry c = _components[0];
                return(c.Buffer.GetSpan(index, count));

            default:
                var idx = ToComponentIndex0(index);
                if (idx == ToComponentIndex0(index + count - 1))
                {
                    ComponentEntry c1 = _components[idx];
                    return(c1.Buffer.GetSpan(c1.Idx(index), count));
                }
                throw ThrowHelper.GetNotSupportedException();
            }
        }
        protected internal override Span <byte> _GetSpan(int index, int count)
        {
            if (0u >= (uint)count)
            {
                return(Span <byte> .Empty);
            }

            switch (_componentCount)
            {
            case 0:
                return(Span <byte> .Empty);

            case 1:
                ComponentEntry c = _components[0];
                return(c.Buffer.GetSpan(index, count));

            default:
                throw ThrowHelper.GetNotSupportedException();
            }
        }
Ejemplo n.º 3
0
 public IByteBuffer AdjustCapacity(int newCapacity) => throw ThrowHelper.GetNotSupportedException();
Ejemplo n.º 4
0
 public ref byte GetPinnableMemoryAddress() => throw ThrowHelper.GetNotSupportedException();