Class MemoryByteBuffer
Inheritance
System.Object
MemoryByteBuffer
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FellowOakDicom.IO.Buffer
Assembly: fo-dicom.core.dll
Syntax
public sealed class MemoryByteBuffer : IByteBuffer
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
Declaration
public MemoryByteBuffer(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data |
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)
Declaration
public const int MaxArrayLength = 2147483591
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
Data
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
IsMemory
Declaration
public bool IsMemory { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Size
Declaration
public long Size { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
CopyToStream(Stream)
Declaration
public void CopyToStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream |
CopyToStreamAsync(Stream, CancellationToken)
Declaration
public async Task CopyToStreamAsync(Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
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 |