SliceBufferWriterExtensions
Namespace: SnowBank.Buffers · class
Helper methods for working with slice allocators and writers
Methods
Intern
static Slice Intern(ISliceAllocator writer, ReadOnlySpan<byte> data)
Returns a copy of a span of bytes using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copy
Returns: New slice, with identical content.
static Slice Intern(ISliceAllocator writer, ReadOnlyMemory<byte> data)
Returns a copy of a span of bytes using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copy
Returns: New slice, with identical content.
static Slice Intern(ISliceAllocator writer, Slice data)
Returns a copy of a Slice, using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copy
Returns: New slice, with identical content.
static Slice Intern(ISliceAllocator writer, ReadOnlySpan<byte> data, Slice suffix)
Returns a copy of a span of bytes using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copysuffix— Extra bytes that will be copied afterdata
Returns: New slice, with identical content plus the extra suffix.
static Slice Intern(ISliceAllocator writer, ReadOnlySpan<byte> data, byte suffix)
Returns a copy of a span of bytes using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copysuffix— Extra byte that will be copied afterdata
Returns: New slice, with identical content plus the extra suffix.
static Slice Intern(ISliceAllocator writer, ReadOnlyMemory<byte> data, Slice suffix)
Returns a copy of a span of bytes using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copysuffix— Extra bytes that will be copied afterdata
Returns: New slice, with identical content plus the extra suffix.
static Slice Intern(ISliceAllocator writer, ReadOnlyMemory<byte> data, byte suffix)
Returns a copy of a span of bytes using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copysuffix— Extra byte that will be copied afterdata
Returns: New slice, with identical content plus the extra suffix.
static Slice Intern(ISliceAllocator writer, Slice data, Slice suffix)
Returns a copy of a Slice, using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copysuffix— Extra bytes that will be copied afterdata
Returns: New slice, with identical content plus the extra suffix.
static Slice Intern(ISliceAllocator writer, Slice data, byte suffix)
Returns a copy of a Slice, using this allocator to allocate memory.
writer— Allocator that will store the bytesdata— Bytes to copysuffix— Extra byte that will be copied afterdata
Returns: New slice, with identical content plus the extra suffix.