示例#1
0
 private TextExtractor(ReadOnlyMemory <byte> bytes)
 {
     _stream        = new MemoryStream(bytes.GetUnderlyingArray().Array);
     _contentType   = ContentTypeExtractor.Extract(bytes);
     _disposeStream = true;
 }
示例#2
0
 private TextExtractor(byte[] bytes)
 {
     _stream        = new MemoryStream(bytes);
     _contentType   = ContentTypeExtractor.Extract(bytes);
     _disposeStream = true;
 }
示例#3
0
 private TextExtractor(string filePath)
 {
     _stream        = File.OpenRead(filePath);
     _contentType   = ContentTypeExtractor.Extract(Path.GetFileName(filePath));
     _disposeStream = true;
 }
示例#4
0
 private TextExtractor(Stream stream)
 {
     _stream        = stream;
     _contentType   = ContentTypeExtractor.Extract(stream);
     _disposeStream = false;
 }
示例#5
0
 private TextExtractor(FileStream fileStream)
 {
     _stream        = fileStream;
     _contentType   = ContentTypeExtractor.Extract(fileStream.Name);
     _disposeStream = false;
 }