Class EvenLengthBuffer
Wrapper class for uneven length buffers that needs to be represented as even length buffers.
Inheritance
Implements
Inherited Members
Namespace: FellowOakDicom.IO.Buffer
Assembly: fo-dicom.core.dll
Syntax
public class EvenLengthBuffer : IByteBuffer
Properties
Buffer
Underlying uneven length buffer.
Declaration
public IByteBuffer Buffer { get; }
Property Value
Type | Description |
---|---|
IByteBuffer |
Data
Gets the buffer data, which is equal to the underlying buffer data plus a padding byte at the end.
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
IsMemory
Gets whether the buffer is held in memory.
Declaration
public bool IsMemory { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Size
Gets the size of the even length buffer, which is always equal to the underlying (uneven length) buffer plus 1.
Declaration
public long Size { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
CopyToStream(Stream)
Declaration
public void CopyToStream(Stream s)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s |
CopyToStreamAsync(Stream, CancellationToken)
Declaration
public async Task CopyToStreamAsync(Stream s, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Create(IByteBuffer)
If necessary, creates an even length buffer for the specified buffer
.
Declaration
public static IByteBuffer Create(IByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
IByteBuffer | buffer | Buffer that is required to be of even length. |
Returns
Type | Description |
---|---|
IByteBuffer | If |
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 |