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
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
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
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
StreamcancellationToken
CancellationTokenA cancellation token that halts the execution of the copy operation
Returns
Create(IByteBuffer)
If necessary, creates an even length buffer for the specified buffer
.
public static IByteBuffer Create(IByteBuffer buffer)
Parameters
buffer
IByteBufferBuffer that is required to be of even length.
Returns
- IByteBuffer
If
buffer
is of uneven length, returns an even length buffer wrapping thebuffer
, 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)