GetChars() public method

public GetChars ( byte bytes ) : char[]
bytes byte
return char[]
コード例 #1
0
		// 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));
		}
コード例 #2
0
 public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
 {
     return(encoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex));
 }
コード例 #3
-1
		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));
		}