Class MemoryByteBuffer
- Namespace
- FellowOakDicom.IO.Buffer
- Assembly
- fo-dicom.core.dll
public sealed class MemoryByteBuffer : IByteBuffer
- Inheritance
-
MemoryByteBuffer
- Implements
- Inherited Members
- Extension Methods
Constructors
MemoryByteBuffer(byte[])
Creates a new MemoryByteBuffer based on a byte-array. This class takes over ownership of the array, so only pass an array that will not be used/manipulated by other classes, or pass a new instance of byte array
public MemoryByteBuffer(byte[] data)
Parameters
data
byte[]
Fields
MaxArrayLength
This is the maximum number of bytes C# allows to store in a byte array (note that it is slightly lower than int.MaxValue)
public const int MaxArrayLength = 2147483591
Field Value
Properties
Data
Gets the data.
public byte[] Data { get; }
Property Value
- byte[]
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
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
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)