Class SwiftReader
The SwiftReader reads SWIFT data from a binary input stream.
public class SwiftReader
- Inheritance
-
SwiftReader
- Inherited Members
Constructors
SwiftReader(Stream, SwiftOptions)
Creates an SwiftReader reading from the given input stream.
public SwiftReader(Stream aInputStream, SwiftOptions nOptions)
Parameters
aInputStream
StreamStream that provides the binary SWIFT data. This must not be null and must be a readable stream. The stream will not be sought, hence it is not required that the stream is seekable.
nOptions
SwiftOptionsFlags that control the strictness of the SWIFT parsing.
Exceptions
- ArgumentNullException
The parameter aInputStream was null.
SwiftReader(TextReader, SwiftOptions)
Creates an SwiftReader reading from the given TextReader.
public SwiftReader(TextReader aTextReader, SwiftOptions nOptions)
Parameters
aTextReader
TextReaderThe TextReader to read the SWIFT data from. This must not be null.
nOptions
SwiftOptionsFlags that control the strictness of the SWIFT parsing.
Exceptions
- ArgumentNullException
The parameter aTextReader was null.
SwiftReader(string, SwiftOptions)
Creates an SwiftReader reading from the given text block string.
public SwiftReader(string sTextBlock, SwiftOptions nOptions)
Parameters
sTextBlock
stringString that provides the SWIFT text block data. This must not be null.
nOptions
SwiftOptionsFlags that control the strictness of the SWIFT parsing.
Exceptions
- ArgumentNullException
The parameter sTextBlock was null.
Properties
Encoding
The default encoding of binary SWIFT data.
public static Encoding Encoding { get; }
Property Value
Gotchas
Indicates which processing options have actually been encountered when parsing the SWIFT input.
public SwiftOptions Gotchas { get; }
Property Value
Line
Provides the current line number in the SWIFT stream.
public int Line { get; }
Property Value
- int
The very first line of a SWIFT stream has the line number one. The line number is incremented by every CRLF sequence that was encountered in the SWIFT stream. After parsing is complete this property holds the total number of lines.
MT535_FixApoBank_16SADDINFO16R
public bool? MT535_FixApoBank_16SADDINFO16R { get; set; }
Property Value
- bool?
Options
Flags that control the strictness of the SWIFT parsing.
public SwiftOptions Options { get; set; }
Property Value
State
Indicates the current state of this SwiftReader instance.
public SwiftReaderState State { get; }
Property Value
Methods
ReadField()
Reads the next SWIFT field from the input stream and returns it.
public SwiftField ReadField()
Returns
- SwiftField
Returns a new instance of the SwiftField class that contains the details of the SWIFT field that was read. If the end of the input stream was reached, then null is returned.
Exceptions
- SwiftException
The input stream did not provide an appropriately formatted SWIFT data stream.
- IOException
May be thrown by the stream when reading bytes from it.
- InvalidOperationException
This instance of the SwiftReader is already in one of the final states EndOfStream or Error and cannot continue.