2020-01-22 20:00:07 +00:00
|
|
|
#pragma warning disable CS1591
|
2020-08-20 15:59:27 +00:00
|
|
|
#pragma warning disable CA1305
|
2020-01-22 20:00:07 +00:00
|
|
|
|
2019-01-13 19:54:44 +00:00
|
|
|
using System;
|
2016-11-04 08:31:05 +00:00
|
|
|
using System.IO;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
namespace Emby.Dlna.Didl
|
|
|
|
{
|
|
|
|
public class StringWriterWithEncoding : StringWriter
|
|
|
|
{
|
2021-05-07 12:43:50 +00:00
|
|
|
private readonly Encoding? _encoding;
|
2016-11-04 08:31:05 +00:00
|
|
|
|
|
|
|
public StringWriterWithEncoding()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(IFormatProvider formatProvider)
|
|
|
|
: base(formatProvider)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(StringBuilder sb)
|
2020-08-20 15:59:27 +00:00
|
|
|
: base(sb)
|
2016-11-04 08:31:05 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(StringBuilder sb, IFormatProvider formatProvider)
|
|
|
|
: base(sb, formatProvider)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(Encoding encoding)
|
|
|
|
{
|
|
|
|
_encoding = encoding;
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(IFormatProvider formatProvider, Encoding encoding)
|
|
|
|
: base(formatProvider)
|
|
|
|
{
|
|
|
|
_encoding = encoding;
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(StringBuilder sb, Encoding encoding)
|
2020-08-20 15:59:27 +00:00
|
|
|
: base(sb)
|
2016-11-04 08:31:05 +00:00
|
|
|
{
|
|
|
|
_encoding = encoding;
|
|
|
|
}
|
|
|
|
|
|
|
|
public StringWriterWithEncoding(StringBuilder sb, IFormatProvider formatProvider, Encoding encoding)
|
|
|
|
: base(sb, formatProvider)
|
|
|
|
{
|
|
|
|
_encoding = encoding;
|
|
|
|
}
|
|
|
|
|
2020-04-02 14:49:58 +00:00
|
|
|
public override Encoding Encoding => _encoding ?? base.Encoding;
|
2016-11-04 08:31:05 +00:00
|
|
|
}
|
|
|
|
}
|