示例#1
0
        /// <summary>
        /// ToString overridden for debugger convenience. This displays the "active" byte information in this block as ASCII characters.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            var builder = new StringBuilder();

            SpanLiteralExtensions.AppendAsLiteral(Memory.Span, builder);
            return(builder.ToString());
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            var sb = new StringBuilder();

            foreach (var buffer in this)
            {
                SpanLiteralExtensions.AppendAsLiteral(buffer.Span, sb);
            }
            return(sb.ToString());
        }
示例#3
0
 public override string ToString()
 {
     if (typeof(T) == typeof(byte))
     {
         if (this is ReadOnlyBuffer <byte> bytes)
         {
             var sb = new StringBuilder();
             foreach (var buffer in bytes)
             {
                 SpanLiteralExtensions.AppendAsLiteral(buffer.Span, sb);
             }
             return(sb.ToString());
         }
     }
     return(base.ToString());
 }
示例#4
0
 public override string ToString()
 {
     if (typeof(T) == typeof(byte))
     {
         // Suning: walkaround
         var bytes = (ReadOnlyBuffer <byte>)((object)this);
         //if (this is ReadOnlyBuffer<byte> bytes)
         //{
         var sb = new StringBuilder();
         foreach (var buffer in bytes)
         {
             SpanLiteralExtensions.AppendAsLiteral(buffer.Span, sb);
         }
         return(sb.ToString());
         //}
     }
     return(base.ToString());
 }