computerline1z / okapi

Automatically exported from code.google.com/p/okapi
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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;

Original issue reported on code.google.com by jhargrav...@gmail.com on 11 Apr 2014 at 9:59

GoogleCodeExporter commented 9 years ago
This appears to be fixed with the latest resource factor and using 
INputStreamFromOutputStream

Original comment by jhargrav...@gmail.com on 25 Apr 2014 at 8:11