Interface IByteSource
- Namespace
- FellowOakDicom.IO
- Assembly
- fo-dicom.core.dll
Byte source interface for reading operations.
public interface IByteSource- Extension Methods
Properties
Endian
Gets or sets the endianness.
Endian Endian { get; set; }Property Value
IsEOF
Gets whether end-of-source is reached.
bool IsEOF { get; }Property Value
Position
Gets the current read position.
long Position { get; }Property Value
Methods
GetBuffer(uint)
Gets a byte buffer of specified length from the current position and moves to subsequent position.
IByteBuffer GetBuffer(uint count)Parameters
- countuint
- Number of bytes to read. 
Returns
- IByteBuffer
- Byte buffer containing the read bytes. 
GetBufferAsync(uint)
Asynchronously gets a byte buffer of specified length from the current position and moves to subsequent position.
Task<IByteBuffer> GetBufferAsync(uint count)Parameters
- countuint
- Number of bytes to read. 
Returns
- Task<IByteBuffer>
- Awaitable byte buffer containing the read bytes. 
GetBytes(byte[], int, int)
Gets a specified number of bytes from the current position and moves to subsequent position.
The bytes will be written to buffer
int GetBytes(byte[] buffer, int index, int count)Parameters
- bufferbyte[]
- The buffer to write the bytes to 
- indexint
- The index in the buffer at which to start writing 
- countint
- Number of bytes to read. 
Returns
- int
- The number of bytes that were filled in the buffer 
GetBytes(int)
Gets a specified number of bytes from the current position and moves to subsequent position.
byte[] GetBytes(int count)Parameters
- countint
- Number of bytes to read. 
Returns
- byte[]
- Array of bytes. 
GetDouble()
Gets a double precision floating point value (64 bits) from the current position and moves to subsequent position.
double GetDouble()Returns
- double
- Double precision floating point value. 
GetInt16()
Gets a signed short (16 bits) from the current position and moves to subsequent position.
short GetInt16()Returns
- short
- Signed short. 
GetInt32()
Gets a signed integer (32 bits) from the current position and moves to subsequent position.
int GetInt32()Returns
- int
- Signed integer. 
GetInt64()
Gets a signed long (64 bits) from the current position and moves to subsequent position.
long GetInt64()Returns
- long
- Signed long. 
GetSingle()
Gets a single precision floating point value (32 bits) from the current position and moves to subsequent position.
float GetSingle()Returns
- float
- Single precision floating point value. 
GetStream()
Get stream of this byte source.
Stream GetStream()Returns
- Stream
- The stream. 
GetUInt16()
Gets an unsigned short (16 bits) from the current position and moves to subsequent position.
ushort GetUInt16()Returns
- ushort
- Unsigned short. 
GetUInt32()
Gets an unsigned integer (32 bits) from the current position and moves to subsequent position.
uint GetUInt32()Returns
- uint
- Unsigned integer. 
GetUInt64()
Gets an unsigned long (64 bits) from the current position and moves to subsequent position.
ulong GetUInt64()Returns
- ulong
- Unsigned long. 
GetUInt8()
Gets one byte from the current position and moves to subsequent position.
byte GetUInt8()Returns
- byte
- Single byte. 
GoTo(long)
Sets the current read position to the position position
void GoTo(long position)Parameters
- positionlong
- the position to seek to 
Require(uint)
Verifies that there is a sufficient number of bytes to read.
bool Require(uint count)Parameters
- countuint
- Required number of bytes. 
Returns
- bool
- true if source contains sufficient number of remaining bytes, false otherwise. 
Require(uint, ByteSourceCallback, object)
Verifies that there is a sufficient number of bytes to read.
bool Require(uint count, ByteSourceCallback callback, object state)Parameters
- countuint
- Required number of bytes. 
- callbackByteSourceCallback
- Byte source callback. 
- stateobject
- Callback state. 
Returns
- bool
- true if source contains sufficient number of remaining bytes, false otherwise. 
Skip(uint)
Skip position count number of bytes.
void Skip(uint count)Parameters
- countuint
- Number of bytes to skip.