C# Class LumiSoft.Net.Core

Provides net core utility methods.
Show file Open project: jeske/StepsDB-alpha

Public Methods

Method Description
Base64Decode ( byte base64Data ) : byte[]

Decodes base64 data.

Base64Encode ( byte data ) : byte[]

Encodes data with base64 encoding.

CanonicalDecode ( string text ) : string

Canonical decoding. Decodes all canonical encoding occurences in specified text. Usually mime message header unicode/8bit values are encoded as Canonical. Format: =?charSet?type[Q or B]?encoded_string?= . Defined in RFC 2047.

CanonicalEncode ( string str, string charSet ) : string

Canonical encoding.

DoPeriodHandling ( Stream strm, bool add_Remove ) : MemoryStream

Does period handling.

DoPeriodHandling ( Stream strm, bool add_Remove, bool setStrmPosTo0 ) : MemoryStream

Does period handling.

DoPeriodHandling ( byte data, bool add_Remove ) : MemoryStream

Does period handling.

FromHex ( byte hexData ) : byte[]

Converts hex byte data to normal byte data. Hex data must be in two bytes pairs, for example: 0F,FF,A3,... .

GetArgsText ( string input, string cmdTxtToRemove ) : string

Gets argument part of command text.

GetHostName ( IPAddress IP ) : string

Gets host name. If fails returns 'UnkownHost'.

IsAscii ( string data ) : bool

Checks if specified string data is acii data.

IsNumber ( string str ) : bool

Checks if specified string is number(long).

QDecode ( System encoding, string data ) : string

"Q" decoder. This is same as quoted-printable, except '_' is converted to ' '.

QuotedPrintableDecode ( System encoding, byte data, bool includeCRLF ) : string

quoted-printable decoder.

QuotedPrintableDecodeB ( byte data, bool includeCRLF ) : byte[]

quoted-printable decoder.

QuotedPrintableEncode ( byte data ) : byte[]

Encodes data with quoted-printable encoding.

ScanInvalid_CR_or_LF ( Stream strm ) : bool

Scans invalid CR or LF combination in stream. Returns true if contains invalid CR or LF combination.

ToHex ( byte byteValue ) : byte[]

Convert byte to hex data.

Method Details

Base64Decode() public static method

Decodes base64 data.
public static Base64Decode ( byte base64Data ) : byte[]
base64Data byte Base64 decoded data.
return byte[]

Base64Encode() public static method

Encodes data with base64 encoding.
public static Base64Encode ( byte data ) : byte[]
data byte Data to encode.
return byte[]

CanonicalDecode() public static method

Canonical decoding. Decodes all canonical encoding occurences in specified text. Usually mime message header unicode/8bit values are encoded as Canonical. Format: =?charSet?type[Q or B]?encoded_string?= . Defined in RFC 2047.
public static CanonicalDecode ( string text ) : string
text string Text to decode.
return string

CanonicalEncode() public static method

Canonical encoding.
public static CanonicalEncode ( string str, string charSet ) : string
str string String to encode.
charSet string With what charset to encode string. If you aren't sure about it, utf-8 is suggested.
return string

DoPeriodHandling() public static method

Does period handling.
public static DoPeriodHandling ( Stream strm, bool add_Remove ) : MemoryStream
strm Stream Input stream.
add_Remove bool If true add periods, else removes periods.
return System.IO.MemoryStream

DoPeriodHandling() public static method

Does period handling.
public static DoPeriodHandling ( Stream strm, bool add_Remove, bool setStrmPosTo0 ) : MemoryStream
strm Stream Input stream.
add_Remove bool If true add periods, else removes periods.
setStrmPosTo0 bool If true sets stream position to 0.
return System.IO.MemoryStream

DoPeriodHandling() public static method

Does period handling.
public static DoPeriodHandling ( byte data, bool add_Remove ) : MemoryStream
data byte
add_Remove bool If true add periods, else removes periods.
return System.IO.MemoryStream

FromHex() public static method

Converts hex byte data to normal byte data. Hex data must be in two bytes pairs, for example: 0F,FF,A3,... .
public static FromHex ( byte hexData ) : byte[]
hexData byte Hex data.
return byte[]

GetArgsText() public static method

Gets argument part of command text.
public static GetArgsText ( string input, string cmdTxtToRemove ) : string
input string Input srting from where to remove value.
cmdTxtToRemove string Command text which to remove.
return string

GetHostName() public static method

Gets host name. If fails returns 'UnkownHost'.
public static GetHostName ( IPAddress IP ) : string
IP System.Net.IPAddress
return string

IsAscii() public static method

Checks if specified string data is acii data.
public static IsAscii ( string data ) : bool
data string
return bool

IsNumber() public static method

Checks if specified string is number(long).
public static IsNumber ( string str ) : bool
str string
return bool

QDecode() public static method

"Q" decoder. This is same as quoted-printable, except '_' is converted to ' '.
public static QDecode ( System encoding, string data ) : string
encoding System Input string encoding.
data string String which to encode.
return string

QuotedPrintableDecode() public static method

quoted-printable decoder.
public static QuotedPrintableDecode ( System encoding, byte data, bool includeCRLF ) : string
encoding System Input string encoding.
data byte Data which to encode.
includeCRLF bool Specified if line breaks are included or skipped.
return string

QuotedPrintableDecodeB() public static method

quoted-printable decoder.
public static QuotedPrintableDecodeB ( byte data, bool includeCRLF ) : byte[]
data byte Data which to encode.
includeCRLF bool Specified if line breaks are included or skipped. For text data CRLF is usually included and for binary data excluded.
return byte[]

QuotedPrintableEncode() public static method

Encodes data with quoted-printable encoding.
public static QuotedPrintableEncode ( byte data ) : byte[]
data byte Data to encode.
return byte[]

ScanInvalid_CR_or_LF() public static method

Scans invalid CR or LF combination in stream. Returns true if contains invalid CR or LF combination.
public static ScanInvalid_CR_or_LF ( Stream strm ) : bool
strm Stream Stream which to check.
return bool

ToHex() public static method

Convert byte to hex data.
public static ToHex ( byte byteValue ) : byte[]
byteValue byte Byte to convert.
return byte[]