Class SwiftMessage

Namespace
Subsembly.Swift
Assembly
Subsembly.Sepa.dll

Represents a single SWIFT Message that consists of a series of SWIFT Message Blocks.

public class SwiftMessage
Inheritance
SwiftMessage
Inherited Members

Properties

Blocks

The sequence of SWIFT Message Blocks that make up this SWIFT Message.

public SwiftBlockSequence Blocks { get; }

Property Value

SwiftBlockSequence

LogicalTerminalID

The Logical Terminal Identification from the Basic Header Block.

public SepaBIC LogicalTerminalID { get; }

Property Value

SepaBIC

The returned value is a SepaBIC without the Terminal Code. Yet, the Terminal Code character can still be found in the TerminalCode field.

Exceptions

SwiftException

If a Basic Header Block exists, but the Logical Terminal ID could not be extracted from it, then a SwiftException with Code MalformedBlock is thrown.

MessageType

The SWIFT Message Type of this SWIFT Message.

public int MessageType { get; }

Property Value

int

The Message Type is extracted from the Application Header Block of the SWIFT Message. If no Application Header Block is present, or the Application Header Block is null or empty, then this property is zero.

Exceptions

SwiftException

If an Application Header Block exists, but the Message Type could not be extracted from it, then a SwiftException with Code MalformedBlock is thrown.

TextBlock

The Text Block data of this SWIFT Message.

public string TextBlock { get; }

Property Value

string

If no Text Block is present, or the Text Block data is empty, then this property is null.

Methods

Read(Stream, int)

Reads a single SWIFT Message from an input stream.

public int Read(Stream aInputStream, int nMaxBytes)

Parameters

aInputStream Stream

The Stream to read the data from.

nMaxBytes int

The maximum number of bytes to read from the stream. Use Int32.MaxValue if you do not want to impose any limit. If this is zero, then this method will simply clear this instance.

Returns

int

Returns the actual number of bytes that have been consumed from the input stream. If the input stream was already at the EOF position when this method was called, then zero is returned. If the parameter nMaxBytes was zero, then this method immediately returns zero, too.

Exceptions

ArgumentNullException

The parameter aInputStream was null.

ArgumentOutOfRangeException

The parameter nMaxBytes was negative.