Class CompositeByteBuffer
Implementation of an IByteBuffer consisting of a collection of IByteBuffer instances.
Inheritance
Implements
Inherited Members
Namespace: FellowOakDicom.IO.Buffer
Assembly: fo-dicom.core.dll
Syntax
public class CompositeByteBuffer : IByteBuffer
Constructors
CompositeByteBuffer(IByteBuffer[])
Initializes an instance of the CompositeByteBuffer class.
Declaration
public CompositeByteBuffer(params IByteBuffer[] buffers)
Parameters
Type | Name | Description |
---|---|---|
IByteBuffer[] | buffers | Array of buffers to initially constitute the CompositeByteBuffer instance. |
CompositeByteBuffer(IMemoryProvider, IByteBuffer[])
Initializes an instance of the CompositeByteBuffer class.
Declaration
public CompositeByteBuffer(IMemoryProvider memoryProvider, params IByteBuffer[] buffers)
Parameters
Type | Name | Description |
---|---|---|
IMemoryProvider | memoryProvider | The memory provider that will be used to allocate buffers |
IByteBuffer[] | buffers | Array of buffers to initially constitute the CompositeByteBuffer instance. |
CompositeByteBuffer(IMemoryProvider, IEnumerable<IByteBuffer>)
Initializes an instance of the CompositeByteBuffer class.
Declaration
public CompositeByteBuffer(IMemoryProvider memoryProvider, IEnumerable<IByteBuffer> buffers)
Parameters
Type | Name | Description |
---|---|---|
IMemoryProvider | memoryProvider | The memory provider that will be used to allocate buffers |
System.Collections.Generic.IEnumerable<IByteBuffer> | buffers | Collection of buffers to initially constitute the CompositeByteBuffer instance. |
CompositeByteBuffer(IEnumerable<IByteBuffer>)
Initializes an instance of the CompositeByteBuffer class.
Declaration
public CompositeByteBuffer(IEnumerable<IByteBuffer> buffers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IByteBuffer> | buffers | Collection of buffers to initially constitute the CompositeByteBuffer instance. |
Properties
Buffers
Gets the collection of IByteBuffer constituting the CompositeByteBuffer.
Declaration
public IList<IByteBuffer> Buffers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IByteBuffer> |
Data
Gets the data.
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
IsMemory
Gets whether data is buffered in memory or not.
Declaration
public bool IsMemory { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Size
Gets the size of the buffered data.
Declaration
public long Size { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
CopyToStream(Stream)
Declaration
public void CopyToStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream |
CopyToStreamAsync(Stream, CancellationToken)
Declaration
public async Task CopyToStreamAsync(Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
GetByteRange(Int64, Int32, Byte[])
Gets a subset of the data and fills it in the provided output buffer
Declaration
public void GetByteRange(long offset, int count, byte[] output)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | offset | Offset from beginning of data array. |
System.Int32 | count | Number of bytes to return. |
System.Byte[] | output | The array where the data will be written to |