public bool TryWriteLine(string text, TransformationFormat format) { if (!TryWriteLine(text, out int written)) { return(false); } if (!format.TryTransform(Free, ref written)) { return(false); } _written += written; return(true); }
public bool TryWrite <T>(T value, TransformationFormat format) where T : IBufferFormattable { if (!value.TryFormat(Free, out int written, format.Format, SymbolTable.InvariantUtf8)) { return(false); } if (format.TryTransform(Free, ref written)) { _written += written; return(true); } return(false); }
public bool TryWriteBytes <T>(T value, TransformationFormat format) where T : IWritable { if (!value.TryWrite(Free, out int written, format.Format)) { return(false); } if (format.TryTransform(Free, ref written)) { _written += written; return(true); } return(false); }
public bool TryWrite(Utf8Span text, TransformationFormat format) { int written = text.Bytes.Length; if (!text.Bytes.TryCopyTo(Free)) { return(false); } if (!format.TryTransform(Free, ref written)) { return(false); } _written += written; return(true); }