ASN1C C# Runtime Library
7.4
|
Static Public Member Functions | |
static System.String | BCDToString (byte[] bcd) |
static void | CloseRuntime () |
static byte [] | DecodeBase64Array (char[] srcArray) |
static string | EncodeBase64Array (byte[] srcArray) |
static byte [] | GetAddressBytes (string ipaddress) |
static int | GetBytesCount (long val) |
static int | GetUlongBytesCount (long val) |
static int | HexToByte (char c) |
static bool | IsLimited () |
static byte [] | StringToBCD (System.String str) |
static byte [] | StringToTBCD (System.String str) |
static String | StripWhitespace (String value) |
static char | TbcdBinToChar (byte tbcdDigit) |
static byte | TbcdCharToBin (char digit) |
static System.String | TBCDToString (byte[] bcd) |
static void | ToArray (System.Collections.ICollection c, System.Object[] objects) |
static byte [] | ToByteArray (System.String sourceString) |
static char [] | ToCharArray (byte[] byteArray) |
static char | ToHexChar (int nibble) |
static System.String | ToHexString (byte b) |
static System.String | ToHexString (byte[] b, int offset, int nbytes) |
static System.String | ToHexString (byte[] b, int offset, int nbytes, bool spaces) |
static int | URShift (int number, int bits) |
static int | URShift (int number, long bits) |
static long | URShift (long number, int bits) |
static long | URShift (long number, long bits) |
static void | WriteStackTrace (System.Exception throwable, System.IO.TextWriter stream) |
This class contains some general purpose static utility functions.
|
static |
Translates a BCD string to an ASCII string. The returned string will consist of characters in [0..9] and [A-E]. All half-bytes in the input shall be less than 0xF, except that in the final byte, the low half-byte may be 0xF, to act as filler for a string of odd length.
bcd | the source BCD string |
References Asn1Util.URShift().
Referenced by Asn1BCDString.ToString().
|
static |
Signal that you are finished with the ASN1C runtime and release internal resources. Do not use the runtime classes, on any thread, after calling this.
This may be called from any thread.
|
static |
Translates the specified Base64 array into byte array. The resulting array could be converted to the String by new String (byte[])
constructor.
srcArray | Base64 byte array to be translated |
Referenced by Asn1OctetString.DecodeXER(), and Asn1OctetString.DecodeXML().
|
static |
Translates the specified byte array to Base64 string.
srcArray | byte array to be translated |
|
static |
Converts an IPaddress to byte array
ipaddress | String representation of IP Address |
References Tokenizer.HasMoreTokens(), and Tokenizer.NextToken().
|
static |
Calculate the number of bytes necessary to represent a signed long value.
val | singed long value. |
Referenced by Asn1Real.Encode(), Asn1BerOutputStream.EncodeLength(), and Asn1Real.NormalizedRealValueToString().
|
static |
Calculate the number of bytes necessary to represent an unsigned long value.
val | unsinged long value. |
Referenced by Asn1Real.Encode(), and Asn1Real.NormalizedRealValueToString().
|
static |
Return the value of a single hexadecimal character. /p>
c | The hex character (0-9,A-F,a-f) |
Asn1Exception | Thrown if character is not a valid hexadecimal character. |
|
static |
Indicates whether the run-time is limited or unlimited.
|
static |
Translates an ASCII string to a BCD string. The ASCII string must contain only the following characters: [0..9A-Ea-e]. If the length of the source string is not even, the unused part of the last byte will be set to 0xF.
str | the source ASCII string |
Asn1ValueParseException | If invalid characters are in the source string. |
|
static |
Translates an ASCII string to a TBCD string. The TBCD encoding format is as described in 3GPP 29.002:
str | the source ASCII string |
Asn1ValueParseException | If invalid characters are in the source string. |
|
static |
Return the given string with all whitespace characters removed. Here, "whitespace characters" means those characters defined by X.680 12.1.6 as whitespace: HT, LF, VT, FF, CR, SPACE.
Referenced by Asn1OID_IRI.Encode().
|
static |
This function converts a TBCD binary character into its ASCII equivalent. /p>
tbcdDigit | TBCD digit |
|
static |
This function converts a TBCD character ('0'-'9',"*#abc") into its binary equivalent. /p>
digit | TBCD digit character ('0'-'9',"*#abc") |
|
static |
Translates a TBCD string to an ASCII string. Refer to the description of TBCD in stringToTBCD.
bcd | the source TBCD string |
References Asn1Util.URShift().
Referenced by Asn1TBCDString.ToString().
|
static |
Obtains an array containing all the elements of the collection.
c | The Collection instance, which contains the elements. |
objects | The array into which the elements of the collection will be stored. |
|
static |
Converts a string to an array of bytes
sourceString | The string to be converted |
Referenced by Asn1CerOutputStream.EncodeCharString(), and Asn1BerOutputStream.EncodeCharString().
|
static |
Converts an array of bytes to an array of chars
byteArray | The array of bytes to convert |
Referenced by Asn1XmlAnyElem.XsdAnySaxHandler.EndElement(), and Asn1OpenType.SaxHandler.EndElement().
|
static |
Convert a value from 0x0 to 0xF to the corresponding hex char. Lowercase letters are used for the hex characters. /p>
|
static |
Convert a byte value to a hex string. Unlike the C# built-in function, this will:
a. not sign extend the byte value out to 32 bits if the MSB is set, and b. put a zero padding byte in front if less than 0xf
In other words, a character string of length 2 is always returned.
b | byte value |
Referenced by Asn1BerMessageDumpHandler.Contents(), Asn1DecodeBitBuffer.DecodeBitsToLong(), Asn1DecodeBitBuffer.DecodeBitsToOctetArray(), Asn1OpenType.Encode(), Asn1PerBitFieldPrinter.Print(), Diag.Prtln(), Asn1DecodeBuffer.Read(), Asn1BerMessageDumpHandler.StartElement(), Asn1BitString.ToHexString(), and Asn1OctetString.ToString().
|
static |
Convert a array of bytes into a hex string.
b | byte array to be converted to hex string |
offset | start position in byte array |
nbytes | no. of bytes to be converted |
|
static |
Convert a array of bytes into a hex string.
b | byte array to be converted to hex string |
offset | start position in byte array |
nbytes | no. of bytes to be converted |
spaces | Pass true if each byte's hex digits should be followed by a space character. |
|
static |
Performs an unsigned bitwise right shift with the specified number. The low-order bits of number are discarded, the remaining bits are shifted right, and the high-order empty bit positions are set to zero.
number | Number to operate on |
bits | Ammount of bits to shift |
Referenced by Asn1Util.BCDToString(), Asn1DecodeBitBuffer.DecodeBitsToLong(), Asn1Real.Encode(), Asn1XerEncodeBuffer.EncodeBinStrValue(), Asn1XerOutputStream.EncodeBinStrValue(), Asn1XmlEncodeBuffer.EncodeBinStrValue(), Asn1XmlOutputStream.EncodeBinStrValue(), Asn1XmlEncodeBuffer.EncodeByte(), Asn1XerEncodeBuffer.EncodeByte(), Asn1XmlOutputStream.EncodeByte(), Asn1UniversalString.EncodeData(), Asn1BerOutputStream.EncodeIdentifier(), Asn1PerEncodeBuffer.EncodeInt(), Asn1CerOutputStream.EncodeUnivString(), Asn1BerOutputStream.EncodeUnivString(), BigInteger.Init(), Asn1Real.NormalizedRealValueToString(), Asn1PerEncodeBuffer.SetSizeConstraintExt(), and Asn1Util.TBCDToString().
|
static |
Performs an unsigned bitwise right shift with the specified number The low-order bits of number are discarded, the remaining bits are shifted right, and the high-order empty bit positions are set to zero.
number | Number to operate on |
bits | Ammount of bits to shift |
|
static |
Performs an unsigned bitwise right shift with the specified number The low-order bits of number are discarded, the remaining bits are shifted right, and the high-order empty bit positions are set to zero.
number | Number to operate on |
bits | Ammount of bits to shift |
|
static |
Performs an unsigned bitwise right shift with the specified number The low-order bits of number are discarded, the remaining bits are shifted right, and the high-order empty bit positions are set to zero.
number | Number to operate on |
bits | Ammount of bits to shift |
|
static |
Writes the exception stack trace to the received stream
throwable | Exception to obtain information from |
stream | Output sream used to write to |
Referenced by Asn1XmlEncodeBuffer.Copy(), Asn1XerEncodeBuffer.Copy(), Asn1UTF8String.Encode(), Asn1XerOutputStream.Write(), and Asn1XmlOutputStream.Write().