Class DICOMBinaryReader
A wrapper for the Binary Reader class that is specific to DICOM.
Inheritance
Inherited Members
Namespace:EvilDICOM.Core.IO.Reading
Assembly:EvilDICOM.dll
Syntax
public class DICOMBinaryReader : IDisposable
Constructors
View SourceDICOMBinaryReader()
Declaration
protected DICOMBinaryReader()
DICOMBinaryReader(Byte[])
Constructs a new reader from a byte array.
Declaration
public DICOMBinaryReader(byte[] byteStream)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | byteStream | the byte array to be read |
DICOMBinaryReader(String)
Constructs a new reader from a file path.
Declaration
public DICOMBinaryReader(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | path to the file to be read |
Fields
View Source_binaryReader
Declaration
protected BinaryReader _binaryReader
Field Value
Type | Description |
---|---|
System.IO.BinaryReader |
Properties
View SourceStreamLength
Returnts the length of the byte stream
Declaration
public long StreamLength { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
StreamPosition
Returns the current position of the byte stream
Declaration
public long StreamPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
View SourceDispose()
Declaration
public void Dispose()
Implements
GetSubStream(Int32)
Creates a new stream that is trimmed to the specification length.
Declaration
public virtual DICOMBinaryReader GetSubStream(int substreamLength)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | substreamLength | the number of bytes to include in the new stream (starting from the current position) |
Returns
Type | Description |
---|---|
DICOMBinaryReader |
IndexOf(Byte[])
Will return the index of a given byte pattern in the byte stream
Declaration
public long IndexOf(byte[] bytePattern)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytePattern | the pattern to be found |
Returns
Type | Description |
---|---|
System.Int64 | the index of the pattern |
Peek(Int32)
Declaration
public virtual byte[] Peek(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Byte[] |
ReadBytes(Byte[], Int32, Int32)
Declaration
public int ReadBytes(byte[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | |
System.Int32 | index | |
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Int32 |
ReadBytes(Int32)
Reads the specified number of bytes
Declaration
public virtual byte[] ReadBytes(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | the number of bytes to be read |
Returns
Type | Description |
---|---|
System.Byte[] | the read bytes |
ReadChars(Int32)
Reads the specified number of chars
Declaration
public virtual char[] ReadChars(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | the number of chars to be read |
Returns
Type | Description |
---|---|
System.Char[] | the read chars |
ReadString(Int32)
Reads the specified number of chars and converts to a string
Declaration
public virtual string ReadString(int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | length |
Returns
Type | Description |
---|---|
System.String | the read chars |
Reset()
Declaration
public void Reset()
Skip(Int32)
Declaration
public virtual DICOMBinaryReader Skip(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count |
Returns
Type | Description |
---|---|
DICOMBinaryReader |
Take(Int32)
Reads the specified number of bytes (shorthand for ReadBytes method).
Declaration
public virtual byte[] Take(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | the number of bytes to be read |
Returns
Type | Description |
---|---|
System.Byte[] | the read bytes |