public Optional <InputStream> tryGetInputStream(string name)
        {
            var entry = _zipFile[name];

            if (entry == null)
            {
                return(Optional.empty <InputStream>());
            }
            else
            {
                return(Optional.of(ToJava.StreamToInputStream(entry.OpenReader())));
            }
        }
Example #2
0
 internal InputStream openStream()
 {
     try {
         var response = WebRequest.Create(_url).GetResponse();
         try {
             return(ToJava.StreamToInputStream(response.GetResponseStream()));
         } catch {
             response.Close();
             throw;
         }
     } catch (System.UriFormatException) {
         return(ToJava.StreamToInputStream(System.IO.File.OpenRead(_url)));
     } catch (System.Net.WebException exception) {
         throw new java.io.IOException(exception.Message);
     }
 }
Example #3
0
 public IResult <string> ExtractRawText(Stream stream)
 {
     return(new InternalDocumentConverter(options)
            .extractRawText(ToJava.StreamToInputStream(stream))
            .ToResult());
 }
Example #4
0
 public IResult <string> ConvertToHtml(Stream stream)
 {
     return(new InternalDocumentConverter(options)
            .convertToHtml(ToJava.StreamToInputStream(stream))
            .ToResult());
 }