Browse Source

Only keep one ctor.

pull/9180/head
maliming 5 years ago
parent
commit
979538ecaa
  1. 8
      framework/src/Volo.Abp.Core/Volo/Abp/Content/RemoteStreamContent.cs

8
framework/src/Volo.Abp.Core/Volo/Abp/Content/RemoteStreamContent.cs

@ -14,21 +14,17 @@ namespace Volo.Abp.Content
public virtual long? ContentLength { get; } public virtual long? ContentLength { get; }
public RemoteStreamContent(Stream stream, bool disposeStream = true) public RemoteStreamContent(Stream stream, string fileName = null, string contentType = null, long? readOnlyLength = null, bool disposeStream = true)
{ {
_stream = stream; _stream = stream;
_disposeStream = disposeStream;
}
public RemoteStreamContent(Stream stream, string fileName = null, string contentType = null, long? readOnlyLength = null, bool disposeStream = true)
: this(stream, disposeStream)
{
FileName = fileName; FileName = fileName;
if (contentType != null) if (contentType != null)
{ {
ContentType = contentType; ContentType = contentType;
} }
ContentLength = readOnlyLength ?? (_stream.CanSeek ? _stream.Length - _stream.Position : null); ContentLength = readOnlyLength ?? (_stream.CanSeek ? _stream.Length - _stream.Position : null);
_disposeStream = disposeStream;
} }
public virtual Stream GetStream() public virtual Stream GetStream()

Loading…
Cancel
Save