Inheritance: Sharpen.CharSequence
コード例 #1
0
ファイル: CharBuffer.cs プロジェクト: jjoos/NBoilerpipe
 public static CharBuffer Wrap(string str)
 {
     CharBuffer buffer = new CharBuffer ();
     buffer.Wrapped = str;
     return buffer;
 }
コード例 #2
0
ファイル: Base64.cs プロジェクト: Redth/couchbase-lite-net
		// end input remaining
		/// <summary>
		/// Performs Base64 encoding on the <code>raw</code> ByteBuffer,
		/// writing it to the <code>encoded</code> CharBuffer.
		/// </summary>
		/// <remarks>
		/// Performs Base64 encoding on the <code>raw</code> ByteBuffer,
		/// writing it to the <code>encoded</code> CharBuffer.
		/// This is an experimental feature. Currently it does not
		/// pass along any options (such as
		/// <see cref="DoBreakLines">DoBreakLines</see>
		/// or
		/// <see cref="Gzip">Gzip</see>
		/// .
		/// </remarks>
		/// <param name="raw">input buffer</param>
		/// <param name="encoded">output buffer</param>
		/// <since>2.3</since>
		public static void Encode(ByteBuffer raw, CharBuffer encoded)
		{
			byte[] raw3 = new byte[3];
			byte[] enc4 = new byte[4];
			while (raw.HasRemaining())
			{
				int rem = Math.Min(3, raw.Remaining());
				raw.Get(raw3, 0, rem);
				Couchbase.Lite.Support.Base64.Encode3to4(enc4, raw3, rem, Couchbase.Lite.Support.Base64
					.NoOptions);
				for (int i = 0; i < 4; i++)
				{
					encoded.Put((char)(enc4[i] & unchecked((int)(0xFF))));
				}
			}
		}