/// <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()); }
/// <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()); }
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()); }
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()); }