MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / Remove

Method Remove

projects/CSharp/Proto/com.chronoxor.fbe.cs:176–192  ·  view source on GitHub ↗

Remove some memory of the given size from the current buffer

(long offset, long size)

Source from the content-addressed store, hash-verified

174
175 // Remove some memory of the given size from the current buffer
176 public void Remove(long offset, long size)
177 {
178 Debug.Assert(((offset + size) <= Size), "Invalid offset & size!");
179 if ((offset + size) > Size)
180 throw new ArgumentException("Invalid offset & size!", nameof(offset));
181
182 Array.Copy(_data, offset + size, _data, offset, _size - size - offset);
183 _size -= size;
184 if (_offset >= (offset + size))
185 _offset -= size;
186 else if (_offset >= offset)
187 {
188 _offset -= _offset - offset;
189 if (_offset > Size)
190 _offset = Size;
191 }
192 }
193
194 // Reserve memory of the given capacity in the current buffer
195 public void Reserve(long capacity)

Callers

nothing calls this directly

Calls 1

CopyMethod · 0.45

Tested by

no test coverage detected