OpenXml filter cannot be stopped before filtering is finsihed...

Issue #402 resolved
Former user created an issue

Original issue 402 created by @ysavourel on 2014-04-11T21:59:15.000Z:

Code like the snippet below will cause a "OkapiIOException: Can't read piped input." and WARN net.sf.okapi.filters.openxml.OpenXMLContentFilter - Problem writing piped stream.

It may take a few passes. In our code we were running a merge with the same filter (XLIFFMergingStep). I can provide more extensive code if the snippet below is not enough to reproduce the problem

RawDocument rd = null;
try
{
rd = new RawDocument(targetFile.toURI(), "UTF-8", srcLocale, trgLocale);
f.open(rd);
while(f.hasNext())
{
Event e = f.next();
if(e.isTextUnit() && !e.getTextUnit().isEmpty())
{
return true;
}
}
}
finally
{
if(rd != null) rd.close();
if(f != null) f.close();
}
return false;

Comments (1)

  1. Former user Account Deleted

    Comment 1. originally posted by @ysavourel on 2014-04-25T20:11:30.000Z:

    This appears to be fixed with the latest resource factor and using INputStreamFromOutputStream

  2. Log in to comment