コード例 #1
0
ファイル: Charset.cs プロジェクト: hakeemsm/XobotOS
		public virtual int compareTo (Charset charset)
		{
			return this.canonicalName.CompareTo (charset.canonicalName);
		}
コード例 #2
0
ファイル: Util.cs プロジェクト: hakeemsm/XobotOS
		public static byte[] GetBytesForString (string str, Charset charset)
		{
			MonoCharset mono_set = (MonoCharset)charset;
			return mono_set.Encoding.GetBytes (str);
		}
コード例 #3
0
ファイル: Util.cs プロジェクト: hakeemsm/XobotOS
		public static string GetStringForBytes (byte[] buffer, int offset, int count, Charset charset)
		{
			MonoCharset mono_set = (MonoCharset)charset;
			return mono_set.Encoding.GetString (buffer, offset, count);
		}
コード例 #4
0
ファイル: Util.cs プロジェクト: hakeemsm/XobotOS
		public static string GetStringForBytes (byte[] buffer, Charset charset)
		{
			return GetStringForBytes (buffer, 0, buffer.Length, charset);
		}
コード例 #5
0
ファイル: MonoCharset.cs プロジェクト: hakeemsm/XobotOS
		public override bool contains (Charset charset)
		{
			return charset == this;
		}
コード例 #6
0
 /// <summary>
 /// Initializes a new encoder.  The new encoder will have the given
 /// bytes-per-char values and its replacement will be the
 /// byte array <tt>{</tt>&nbsp;<tt>(byte)'?'</tt>&nbsp;<tt>}</tt>.
 /// </summary>
 /// <param name="cs">
 ///         The charset that created this encoder
 /// </param>
 /// <param name="averageBytesPerChar">
 ///         A positive float value indicating the expected number of
 ///         bytes that will be produced for each input character
 /// </param>
 /// <param name="maxBytesPerChar">
 ///         A positive float value indicating the maximum number of
 ///         bytes that will be produced for each input character
 /// </param>
 /// <exception cref="IllegalArgumentException">
 ///          If the preconditions on the parameters do not hold </exception>
 protected internal CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar) : this(cs, averageBytesPerChar, maxBytesPerChar, new sbyte[] { (sbyte)'?' })
 {
 }