[Serializable] |
The Windows code page that corresponds to ASCIIEncoding is 20127.
This class inherits from the Encoding class.
ctor #1 | Default constructor. This constructor is called by derived class constructors to initialize state in this type. Initializes a new instance of the ASCIIEncoding class. |
BodyName (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.BodyName Gets the name for this encoding that can be used with mail agent body tags. |
CodePage (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.CodePage When overridden in a derived class, gets the code page identifier of this encoding. |
EncodingName (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.EncodingName Gets the human-readable description of the encoding. |
HeaderName (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.HeaderName Gets the name for this encoding that can be used with mail agent header tags. |
IsBrowserDisplay (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.IsBrowserDisplay Gets an indication whether this encoding can be used for display by browser clients. |
IsBrowserSave (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.IsBrowserSave Gets an indication whether this encoding can be used for saving by browser clients. |
IsMailNewsDisplay (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.IsMailNewsDisplay Gets and indication whether this encoding can be used for display by mail and news clients. |
IsMailNewsSave (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.IsMailNewsSave Gets an indication whether this encoding can be used for saving by mail and news clients. |
WebName (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.WebName Gets the name registered with the Internet Assigned Numbers Authority (IANA) for this encoding. |
WindowsCodePage (inherited from System.Text.Encoding) |
Read-only See base class member description: System.Text.Encoding.WindowsCodePage Gets the Windows operating system code page that most closely corresponds to this encoding. |
Equals (inherited from System.Text.Encoding) |
See base class member description: System.Text.Encoding.Equals Determines whether the current instance and the specified Object represent the same type and value. |
GetByteCount (inherited from System.Text.Encoding) |
Overloaded:GetByteCount(char[] chars) See base class member description: System.Text.Encoding.GetByteCountCalculates the number of bytes required to encode a specified character array. |
GetByteCount | Overloaded:GetByteCount(string chars) Overridden: Calculates the number of bytes required to store the results of encoding the characters from a specified String. |
GetByteCount | Overloaded:GetByteCount(char[] chars, int index, int count) Overridden: Calculates the number of bytes required to store the results of encoding a set of characters from a specified Unicode character array. |
GetBytes (inherited from System.Text.Encoding) |
Overloaded:GetBytes(char[] chars) See base class member description: System.Text.Encoding.GetBytesEncodes a specified character array into a byte array. |
GetBytes (inherited from System.Text.Encoding) |
Overloaded:GetBytes(string s) See base class member description: System.Text.Encoding.GetBytesEncodes a specified String into an array of bytes. |
GetBytes (inherited from System.Text.Encoding) |
Overloaded:GetBytes(char[] chars, int index, int count) See base class member description: System.Text.Encoding.GetBytesEncodes a range of characters from a character array into a byte array. |
GetBytes | Overloaded:GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) Overridden: Encodes a specified range of elements from a Unicode character array, and stores the results in a specified range of elements in a byte array. |
GetBytes | Overloaded:GetBytes(string chars, int charIndex, int charCount, byte[] bytes, int byteIndex) Overridden: Encodes a specified range of characters from a String and stores the results in a specified range of elements in a byte array. |
GetCharCount (inherited from System.Text.Encoding) |
Overloaded:GetCharCount(byte[] bytes) See base class member description: System.Text.Encoding.GetCharCountCalculates the number of characters produced by decoding an array of bytes. |
GetCharCount | Overloaded:GetCharCount(byte[] bytes, int index, int count) Overridden: Calculates the number of characters that would result from decoding a specified range of elements in a byte array. |
GetChars (inherited from System.Text.Encoding) |
Overloaded:GetChars(byte[] bytes) See base class member description: System.Text.Encoding.GetCharsDecodes a byte array into an array of characters. |
GetChars (inherited from System.Text.Encoding) |
Overloaded:GetChars(byte[] bytes, int index, int count) See base class member description: System.Text.Encoding.GetCharsDecodes a range of bytes from a byte array into a character array. |
GetChars | Overloaded:GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) Overridden: Decodes a specified range of elements from a byte array, and stores the result into a specified range of elements in a Unicode character array. |
GetDecoder (inherited from System.Text.Encoding) |
See base class member description: System.Text.Encoding.GetDecoder Returns a Decoder for this encoding. |
GetEncoder (inherited from System.Text.Encoding) |
See base class member description: System.Text.Encoding.GetEncoder An Encoder for this encoding. |
GetHashCode (inherited from System.Text.Encoding) |
See base class member description: System.Text.Encoding.GetHashCode Returns the hash code for this instance. |
GetMaxByteCount | Overridden: Calculates the maximum number of bytes required to encode a specified number of characters. |
GetMaxCharCount | Overridden: Calculates the maximum number of characters that can result from decoding a specified number of bytes. |
GetPreamble (inherited from System.Text.Encoding) |
See base class member description: System.Text.Encoding.GetPreamble Returns a set of bytes used at the beginning of a stream to determine which encoding a file was created with. This can include the Unicode byte order mark. |
GetString | Overloaded:GetString(byte[] bytes) Overridden: Converts a specified array of bytes to a String. |
GetString | Overloaded:GetString(byte[] bytes, int byteIndex, int byteCount) Overridden: Converts a specified range of elements in an array of bytes to a String. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public ASCIIEncoding(); |
public virtual string BodyName {get;}
|
If the encoding cannot be used, the property value is the empty string ("").
public virtual int CodePage {get;}
|
public virtual string EncodingName {get;}
|
public virtual string HeaderName {get;}
|
If the encoding cannot be used, the string is empty.
public virtual bool IsBrowserDisplay {get;}
|
public virtual bool IsBrowserSave {get;}
|
public virtual bool IsMailNewsDisplay {get;}
|
public virtual bool IsMailNewsSave {get;}
|
public virtual string WebName {get;}
|
public virtual int WindowsCodePage {get;}
|
value
~ASCIIEncoding(); |
chars
Exception Type | Condition |
---|---|
ArgumentNullException | chars is null. |
Alternatively, Encoding.GetMaxByteCount can be used to determine the maximum number of bytes that will be produced from converting a given number of characters. A buffer of that size can then be reused for multiple conversions.
The Encoding.GetByteCount method generally uses less memory, whereas the Encoding.GetMaxByteCount method generally executes faster.
chars
Exception Type | Condition |
---|---|
ArgumentNullException | chars is null. |
chars
index
count
Exception Type | Condition |
---|---|
ArgumentNullException | chars is null. |
ArgumentOutOfRangeException | index or count is less than zero. -or- index plus count is greater than the length of chars. |
chars
Exception Type | Condition |
---|---|
ArgumentNullException | chars is null. |
s
Exception Type | Condition |
---|---|
ArgumentNullException | s is null. |
chars
index
count
Exception Type | Condition |
---|---|
ArgumentNullException | chars is null. |
ArgumentOutOfRangeException | The index and count parameters do not denote a valid range in chars. |
public override int GetBytes( |
chars
charIndex
charCount
bytes
byteIndex
Exception Type | Condition |
---|---|
ArgumentNullException | chars or bytes is null. |
ArgumentOutOfRangeException | charIndex, charCount, or byteIndex is less than zero. -or- charIndex plus charCount is greater than the length of chars. -or- byteIndex is greater than the length of bytes. |
ArgumentException | The length of bytes minus byteIndex is less than charCount. |
Use ASCIIEncoding.GetByteCount to calculate exactly, or ASCIIEncoding.GetMaxByteCount to calculate at most, the array size required by the ASCIIEncoding.GetBytes method to store encoded characters.
public override int GetBytes( |
chars
charIndex
charCount
bytes
byteIndex
Exception Type | Condition |
---|---|
ArgumentNullException | chars or bytes is null. |
ArgumentOutOfRangeException | charIndex, charCount or byteIndex is less than zero. -or- charIndex plus charCount is greater than the length of chars. -or- byteIndex is greater than the length of bytes. |
ArgumentException | The length of bytes minus byteIndex is less than charCount. |
bytes
Exception Type | Condition |
---|---|
ArgumentNullException | bytes is null. |
Alternatively, the Encoding.GetMaxCharCount method can be used to determine the maximum number of characters that will produced for a given number of bytes. A buffer of that size can then be reused for multiple conversions.
The Encoding.GetCharCount method generally uses less memory, whereas the Encoding.GetMaxCharCount method generally executes faster.
bytes
index
count
Exception Type | Condition |
---|---|
ArgumentNullException | bytes is null. |
ArgumentOutOfRangeException | index or count is less than zero. -or- index plus count is greater than the length of bytes. |
bytes
Exception Type | Condition |
---|---|
ArgumentNullException | bytes is null. |
bytes
index
count
Exception Type | Condition |
---|---|
ArgumentNullException | bytes is null. |
ArgumentOutOfRangeException | index and count do not denote a valid range in the byte array. |
public override int GetChars( |
bytes
byteIndex
byteCount
chars
charIndex
Exception Type | Condition |
---|---|
ArgumentNullException | bytes or chars is null. |
ArgumentOutOfRangeException | byteIndex, byteCount, or charIndex is less than zero. -or- byteIndex plus byteCount is greater than the length of bytes. -or- charIndex is greater than the length of chars. |
ArgumentException | The length of chars minus charIndex is less than byteCount. |
Use ASCIIEncoding.GetCharCount to calculate exactly, or ASCIIEncoding.GetMaxCharCount to calculate at most, the array size required by the ASCIIEncoding.GetChars method to store decoded bytes.
public virtual Decoder GetDecoder(); |
This default implementation returns a Decoder that forwards calls to the Encoding.GetCharCount and Encoding.GetChars methods to the corresponding methods of this encoding. Encodings that require state to be maintained between successive conversions can override this method and return an instance of an appropriate Decoder implementation.
public virtual Encoder GetEncoder(); |
This default implementation returns an Encoder that forwards calls to Encoding.GetByteCount and Encoding.GetBytes to the corresponding methods of this encoding. Encodings that require state to be maintained between successive conversions can override this method and return an instance of an appropriate Encoder implementation.
public override int GetHashCode(); |
charCount
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | charCount is less than zero. |
Use ASCIIEncoding.GetByteCount to calculate exactly, or ASCIIEncoding.GetMaxByteCount to calculate at most, the array size required by the ASCIIEncoding.GetBytes method to store encoded characters.
byteCount
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | byteCount is less than zero. |
Use ASCIIEncoding.GetCharCount to calculate exactly, or ASCIIEncoding.GetMaxCharCount to calculate at most, the array size required by the ASCIIEncoding.GetChars method to store decoded bytes.
public virtual byte[] GetPreamble(); |
bytes
Exception Type | Condition |
---|---|
ArgumentNullException | bytes is null. |
bytes
byteIndex
byteCount
Exception Type | Condition |
---|---|
ArgumentNullException | bytes is null. |
ArgumentOutOfRangeException | byteIndex or byteCount is less than zero. -or- byteIndex plus byteCount is greater than the length of bytes. |
public Type GetType(); |
protected object MemberwiseClone(); |
public virtual string ToString(); |