Class LengthReader
Contains methods for reading the length of DICOM elements
Inheritance
Inherited Members
Namespace:EvilDICOM.Core.IO.Reading
Assembly:EvilDICOM.dll
Syntax
public class LengthReader
Methods
View SourceIsIndefinite(Int32)
Checks to see if length is indefinite type (eg. FFFFFFFF)
Declaration
public static bool IsIndefinite(int length)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | length | the length of the DICOM element |
Returns
| Type | Description |
|---|---|
| System.Boolean |
PeekBigEndian(VR, DICOMBinaryReader)
Declaration
public static int PeekBigEndian(VR vr, DICOMBinaryReader dr)
Parameters
| Type | Name | Description |
|---|---|---|
| VR | vr | |
| DICOMBinaryReader | dr |
Returns
| Type | Description |
|---|---|
| System.Int32 |
PeekLittleEndian(VR, DICOMBinaryReader)
Declaration
public static int PeekLittleEndian(VR vr, DICOMBinaryReader dr)
Parameters
| Type | Name | Description |
|---|---|---|
| VR | vr | |
| DICOMBinaryReader | dr |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Read(VR, DICOMBinaryReader, TransferSyntax)
Reads the length from a series of bytes in a stream. The number of bytes is automatically determined from VR.
Declaration
public static int Read(VR vr, DICOMBinaryReader dr, TransferSyntax syntax)
Parameters
| Type | Name | Description |
|---|---|---|
| VR | vr | the value representation of the element |
| DICOMBinaryReader | dr | the binary stream with a current position on the length parameter |
| TransferSyntax | syntax | the transfer syntax of this element |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ReadBigEndian(VR, DICOMBinaryReader)
Reads the length in big endian byte format from a series of bytes in a stream. The number of bytes is automatically determined from VR.
Declaration
public static int ReadBigEndian(VR vr, DICOMBinaryReader dr)
Parameters
| Type | Name | Description |
|---|---|---|
| VR | vr | the value representation of the element |
| DICOMBinaryReader | dr | the binary stream with a current position on the length parameter |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ReadBigEndian(DICOMBinaryReader, Int32)
Reads the length in big endian byte format from a series of bytes in a stream
Declaration
public static int ReadBigEndian(DICOMBinaryReader dr, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| DICOMBinaryReader | dr | the binary stream with a current position on the length parameter |
| System.Int32 | length | the number of bytes containing the length |
Returns
| Type | Description |
|---|---|
| System.Int32 | the length |
ReadBigEndian(Byte[])
Reads the length in big endian byte format from a series of bytes in a stream
Declaration
public static int ReadBigEndian(byte[] length)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | length | the bytes containing the length |
Returns
| Type | Description |
|---|---|
| System.Int32 | the length |
ReadLittleEndian(VR, DICOMBinaryReader)
Reads the length in little endian byte format from a series of bytes in a stream. The number of bytes is automatically determined from VR.
Declaration
public static int ReadLittleEndian(VR vr, DICOMBinaryReader dr)
Parameters
| Type | Name | Description |
|---|---|---|
| VR | vr | the value representation of the element |
| DICOMBinaryReader | dr | the binary stream with a current position on the length parameter |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ReadLittleEndian(DICOMBinaryReader, Int32)
Reads the length in little endian byte format from a series of bytes in a stream
Declaration
public static int ReadLittleEndian(DICOMBinaryReader dr, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| DICOMBinaryReader | dr | the binary stream with a current position on the length parameter |
| System.Int32 | length | the number of bytes containing the length |
Returns
| Type | Description |
|---|---|
| System.Int32 | the length |
ReadLittleEndian(Byte[])
Reads the length in little endian byte format from a series of bytes in a stream
Declaration
public static int ReadLittleEndian(byte[] length)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | length | the bytes containing the length |
Returns
| Type | Description |
|---|---|
| System.Int32 | the length |