/// <summary> /// Forms a slice out of the given <see cref="ReadableBuffer"/>, beginning at 'start', and is at most length bytes /// </summary> /// <param name="start">The index at which to begin this slice.</param> /// <param name="length">The length of the slice</param> public ReadableBuffer Slice(int start, int length) { var begin = BufferStart.Seek(start, BufferEnd, false); var end = begin.Seek(length, BufferEnd, false); return(Slice(begin, end)); }
public ReadCursor Move(ReadCursor cursor, int count) { if (count < 0) { throw new ArgumentOutOfRangeException(nameof(count)); } return(cursor.Seek(count, BufferEnd, false)); }
/// <summary> /// Forms a slice out of the given <see cref="ReadableBuffer"/>, beginning at 'start', and is at most length bytes /// </summary> /// <param name="start">The starting (inclusive) <see cref="ReadCursor"/> at which to begin this slice.</param> /// <param name="length">The length of the slice</param> public ReadableBuffer Slice(ReadCursor start, int length) { BufferEnd.BoundsCheck(start); var end = start.Seek(length, BufferEnd, false); return(Slice(start, end)); }