Class StreamByteTarget
Representation of a stream byte target.
Inheritance
Implements
Inherited Members
Namespace: FellowOakDicom.IO
Assembly: fo-dicom.core.dll
Syntax
public class StreamByteTarget : IByteTarget
Constructors
StreamByteTarget(Stream)
Initializes an instance of StreamByteTarget.
Declaration
public StreamByteTarget(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream subject to writing. |
Properties
Endian
Gets or sets the endianness of the byte target.
Declaration
public Endian Endian { get; set; }
Property Value
Type | Description |
---|---|
Endian |
Position
Gets the current write position.
Declaration
public long Position { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
AsWritableStream()
Exposes the current byte target as a writable stream Do not dispose of this stream! It will be disposed when the byte target is disposed
Declaration
public Stream AsWritableStream()
Returns
Type | Description |
---|---|
System.IO.Stream | A stream that, when written to, will write to the underlying byte target |
Write(Byte)
Write one System.Byte to target.
Declaration
public void Write(byte v)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | v | System.Byte to write. |
Write(Byte[], UInt32, UInt32)
Write array of System.Bytes to target.
Declaration
public void Write(byte[] buffer, uint offset, uint count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | Array of System.Bytes to write. |
System.UInt32 | offset | Index of first position in |
System.UInt32 | count | Number of bytes to write to byte target. |
Write(Double)
Write one System.Double to target.
Declaration
public void Write(double v)
Parameters
Type | Name | Description |
---|---|---|
System.Double | v | System.Double to write. |
Write(Int16)
Write one System.Int16 to target.
Declaration
public void Write(short v)
Parameters
Type | Name | Description |
---|---|---|
System.Int16 | v | System.Int16 to write. |
Write(Int32)
Write one System.Int32 to target.
Declaration
public void Write(int v)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | v | System.Int32 to write. |
Write(Int64)
Write one System.Int64 to target.
Declaration
public void Write(long v)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | v | System.Int64 to write. |
Write(Single)
Write one System.Single to target.
Declaration
public void Write(float v)
Parameters
Type | Name | Description |
---|---|---|
System.Single | v | System.Single to write. |
Write(UInt16)
Write one System.UInt16 to target.
Declaration
public void Write(ushort v)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | v | System.UInt16 to write. |
Write(UInt32)
Write one System.UInt32 to target.
Declaration
public void Write(uint v)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | v | System.UInt32 to write. |
Write(UInt64)
Write one System.UInt64 to target.
Declaration
public void Write(ulong v)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | v | System.UInt64 to write. |
WriteAsync(Byte[], UInt32, UInt32)
Asynchronously write array of System.Bytes to target.
Declaration
public Task WriteAsync(byte[] buffer, uint offset, uint count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | Array of System.Bytes to write. |
System.UInt32 | offset | Index of first position in |
System.UInt32 | count | Number of bytes to write to byte target. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Avaitable System.Threading.Tasks.Task. |