Class EndianByteBuffer
- Namespace
- FellowOakDicom.IO.Buffer
- Assembly
- fo-dicom.core.dll
Representation of an endian-aware byte buffer.
public class EndianByteBuffer : IByteBuffer
- Inheritance
-
EndianByteBuffer
- Implements
- Inherited Members
- Extension Methods
Properties
Data
Gets the data.
public byte[] Data { get; }
Property Value
- byte[]
Endian
Gets the endianness of the byte buffer.
public Endian Endian { get; }
Property Value
Internal
Gets the original representation of the byte buffer.
public IByteBuffer Internal { get; }
Property Value
IsMemory
Gets whether data is buffered in memory or not.
public bool IsMemory { get; }
Property Value
Size
Gets the size of the buffered data.
public long Size { get; }
Property Value
UnitSize
Gets the unit size of the components in the byte buffer, typically 1 for bytes and 2 for words.
public int UnitSize { get; }
Property Value
Methods
CopyToStream(Stream)
Copies the contents of this buffer to the provided stream
public void CopyToStream(Stream stream)
Parameters
stream
StreamA stream that will receive the contents of this buffer
CopyToStreamAsync(Stream, CancellationToken)
Copies the contents of this buffer to the provided stream
public Task CopyToStreamAsync(Stream stream, CancellationToken cancellationToken)
Parameters
stream
StreamA stream that will receive the contents of this buffer
cancellationToken
CancellationTokenA cancellation token that halts the execution of the copy operation
Returns
Create(IByteBuffer, Endian, int)
Creates a IByteBuffer accounting for endianness and unit size.
public static IByteBuffer Create(IByteBuffer buffer, Endian endian, int unitSize)
Parameters
buffer
IByteBufferOriginal byte buffer.
endian
EndianRequested endianness.
unitSize
intUnit size of the individual components in the
buffer
.
Returns
- IByteBuffer
If required given the
endian
of the local machine and the byte bufferunitSize
, creates an instance of the EndianByteBuffer class, otherwise returns the originalbuffer
.
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)