Table of Contents

Class EvenLengthBuffer

Namespace
FellowOakDicom.IO.Buffer
Assembly
fo-dicom.core.dll

Wrapper class for uneven length buffers that needs to be represented as even length buffers.

public class EvenLengthBuffer : IByteBuffer
Inheritance
EvenLengthBuffer
Implements
Inherited Members
Extension Methods

Properties

Buffer

Underlying uneven length buffer.

public IByteBuffer Buffer { get; }

Property Value

IByteBuffer

Data

Gets the buffer data, which is equal to the underlying buffer data plus a padding byte at the end.

public byte[] Data { get; }

Property Value

byte[]

IsMemory

Gets whether the buffer is held in memory.

public bool IsMemory { get; }

Property Value

bool

Size

Gets the size of the even length buffer, which is always equal to the underlying (uneven length) buffer plus 1.

public long Size { get; }

Property Value

long

Methods

CopyToStream(Stream)

Copies the contents of this buffer to the provided stream

public void CopyToStream(Stream s)

Parameters

s Stream

CopyToStreamAsync(Stream, CancellationToken)

Copies the contents of this buffer to the provided stream

public Task CopyToStreamAsync(Stream s, CancellationToken cancellationToken)

Parameters

s Stream
cancellationToken CancellationToken

A cancellation token that halts the execution of the copy operation

Returns

Task

Create(IByteBuffer)

If necessary, creates an even length buffer for the specified buffer.

public static IByteBuffer Create(IByteBuffer buffer)

Parameters

buffer IByteBuffer

Buffer that is required to be of even length.

Returns

IByteBuffer

If buffer is of uneven length, returns an even length buffer wrapping the buffer, otherwise returns the buffer itself.

GetByteRange(long, int, byte[])

Gets a subset of the data and fills it in the provided output buffer

public void GetByteRange(long offset, int count, byte[] output)

Parameters

offset long

Offset from beginning of data array.

count int

Number of bytes to return.

output byte[]

The array where the data will be written to