using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Text; namespace Renci.SshNet.Common { public partial class ASCIIEncoding : Encoding { /// /// Gets the name registered with the /// Internet Assigned Numbers Authority (IANA) for the current encoding. /// /// /// The IANA name for the current . /// public override string WebName { get { return "iso-8859-1"; } } /// /// Decodes all the bytes in the specified byte array into a string. /// /// The byte array containing the sequence of bytes to decode. /// /// A containing the results of decoding the specified sequence of bytes. /// /// The byte array contains invalid Unicode code points. /// /// /// is null. /// /// A fallback occurred (see Understanding Encodings for complete explanation)-and- is set to . public String GetString(byte[] bytes) { if (bytes == null) { throw new ArgumentNullException("bytes"); } if (bytes.Length == 0) { return String.Empty; } int count = bytes.Length; int posn = 0; char[] chars = new char[count]; while (count-- > 0) { chars[posn] = (char)(bytes[posn]); ++posn; } return new string(chars); } } }