AsnFormatterBinaryToString(Byte, EncodingType, EncodingFormat, Int32, Int32, Boolean) Method

Converts and formats byte array to a string. See EncodingType for encoding examples.

Definition

Namespace: SysadminsLV.Asn1Parser
Assembly: SysadminsLV.Asn1Parser (in SysadminsLV.Asn1Parser.dll) Version: 1.2.11
C#
public static string BinaryToString(
	byte[] rawData,
	EncodingType encoding = EncodingType.HexRaw,
	EncodingFormat format = EncodingFormat.CRLF,
	int start = 0,
	int count = 0,
	bool forceUpperCase = false
)

Parameters

rawData  Byte
Byte array to format.
encoding  EncodingType  (Optional)
Specifies the encoding for formatting. Default is HexRaw
format  EncodingFormat  (Optional)
Specifies the encoding options. The default behavior is to use a carriage return/line feed (CR/LF) pair (0x0D/0x0A) to represent a new line.
start  Int32  (Optional)
Specifies the start position of the byte array to format. Default is zero.
count  Int32  (Optional)
Specifies how many bytes must be formatted. If zero, entire byte array will be encoded.
forceUpperCase  Boolean  (Optional)
Specifies whether the force hex octet representation in upper case. Default is lower case.

This parameter has effect only when hex encoding is selected in the encoding parameter: Hex, HexRaw, HexAddress, HexAscii and HexAsciiAddress. For other values, this parameter is silently ignored.

Return Value

String
Encoded and formatted string.

Remarks

This method do not support the following encoding types:
  • Binary
  • Base64Any
  • StringAny
  • HexAny

Exceptions

ArgumentExceptionAn invalid encoding type was specified.

See Also