Class FinSegmentBuffer

Namespace
Subsembly.FinTS
Assembly
Subsembly.FinTS.Core.dll

A binary byte buffer that holds the raw data of a single HBCI segment.

public class FinSegmentBuffer : FinByteBuffer
Inheritance
FinSegmentBuffer
Inherited Members

Remarks

This is a very low level class that supports the implementation of the higher level FinSegment class. Applications usually only have to deal with the higher level class and never with instances of this class.

Properties

Header

Returns the parsed segment header or null, if there's no data.

public FinSegmentHeader Header { get; }

Property Value

FinSegmentHeader

SegNo

The segment number of the segment contained in this segment buffer.

public int? SegNo { get; }

Property Value

int?

Remarks

If this segment buffer is completely empty, then null will be returned. There's no(!) value check for the SegNo - the returned SegNo might exceed 999.

Exceptions

FinParseException

Is thrown if a segment number could not be extracted. This will be the case if no delimiter could be found.

SegmentType

The segment type of the segment contained in this segment buffer.

public string SegmentType { get; }

Property Value

string

Remarks

If this segment buffer is completely empty, then null will be returned. If the segment buffer starts with a special delimiter character, then an empty string is returned.

Exceptions

FinParseException

Is thrown if a segment type could not be extracted. This will be the case if no delimiter could be found.

Version

The segment version of the segment contained in this segment buffer.

public int? Version { get; }

Property Value

int?

Remarks

If this segment buffer is completely empty, then null will be returned. There's no(!) value check for the Version - the returned Version might exceed 999.

Exceptions

FinParseException

Is thrown if a segment version could not be extracted. This will be the case if no delimiter could be found.

Methods

Read(Stream, int, bool)

Reads a complete HBCI segment from the given stream into a FinSegmentBuffer and returns it.

public static FinSegmentBuffer Read(Stream aStream, int nMaxSize, bool fSkipLeadingWhitespace)

Parameters

aStream Stream

Stream to read segment data from.

nMaxSize int

The maximum size of the segment to be read. If the segment exceeds this limit, then a FinParseException will be thrown.

fSkipLeadingWhitespace bool

Returns

FinSegmentBuffer

If a complete segment was successfully read from the stream, then a FinSegmentBuffer instance that contains the segment bytes is returned. If the stream is at its end before any segment byte was read, then null is returned.

Exceptions

FinParseException

If the input stream does not provide syntactically valid FinTS segment data, then a FinParseException is thrown. Syntactically valid means, that the input stream could be dissected into data elements and was properly terminated by a segment delimiter. The content of the data elements is completely irrelevant.

Scan(FinByteBuffer)

public static FinSegmentBuffer Scan(FinByteBuffer aBuffer)

Parameters

aBuffer FinByteBuffer

Returns

FinSegmentBuffer

Scan(byte[])

public static FinSegmentBuffer Scan(byte[] vbBytes)

Parameters

vbBytes byte[]

Returns

FinSegmentBuffer

Scan(byte[], int, int)

Scans a segment from a byte array and wraps it with a FinSegmentBuffer without copying data.

public static FinSegmentBuffer Scan(byte[] vbBytes, int nOffset, int nLength)

Parameters

vbBytes byte[]
nOffset int
nLength int

Returns

FinSegmentBuffer

Exceptions

FinParseException

If the input stream does not provide syntactically valid FinTS segment data, then a FinParseException is thrown. Syntactically valid means, that the input stream could be dissected into data elements and was properly terminated by a segment delimiter. The content of the data elements is completely irrelevant.

ToString()

Converts the content of this segment buffer into a readable string for diagnostic purposes.

public override string ToString()

Returns

string

Remarks

All data elements that are known to be security critical are masked out with bullet characters in the returned string. Also, the complete data contained in a HNVSD segment is masked out with bullets.