GetChars() public méthode

public GetChars ( byte bytes ) : char[]
bytes byte
Résultat char[]
		// Convert between two encodings.
		public static byte[] Convert (Encoding srcEncoding, Encoding dstEncoding, byte[] bytes)
		{
			if (srcEncoding == null)
				throw new ArgumentNullException ("srcEncoding");

			if (dstEncoding == null)
				throw new ArgumentNullException ("dstEncoding");

			if (bytes == null)
				throw new ArgumentNullException ("bytes");

			return dstEncoding.GetBytes (srcEncoding.GetChars (bytes, 0, bytes.Length));
		}
Exemple #2
0
 public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
 {
     return(encoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex));
 }
		public static byte[] Convert (Encoding srcEncoding, Encoding dstEncoding, byte[] bytes, int index, int count)
		{
			if (srcEncoding == null)
				throw new ArgumentNullException ("srcEncoding");

			if (dstEncoding == null)
				throw new ArgumentNullException ("dstEncoding");

			if (bytes == null)
				throw new ArgumentNullException ("bytes");

			if (index < 0 || index > bytes.Length)
				throw new ArgumentOutOfRangeException ("index");

			if (count < 0 || (bytes.Length - index) < count)
				throw new ArgumentOutOfRangeException ("count");

			return dstEncoding.GetBytes (srcEncoding.GetChars (bytes, index, count));
		}