monkmachine commented on PR #558:
URL: https://github.com/apache/tika/pull/558#issuecomment-1130393422

   If I use buffer reader I get the correct output but it's slower: 3s vs 10s 
(it's quite a large file)
   ```    public void jsonConvert() throws FileNotFoundException, IOException {
   
   
   
            //FileInputStream fis = new 
FileInputStream("c:\\temp1\\dwgreadout.json");
               FileOutputStream fos = new 
FileOutputStream("c:\\temp1\\dwgreadoutClean.json");
               try (BufferedReader br = new BufferedReader(new 
FileReader("c:\\temp1\\dwgreadout.json"))) 
               {
   
                   String sCurrentLine;
                   while ((sCurrentLine = br.readLine()) != null) 
                   {
                        sCurrentLine = sCurrentLine
                            .replaceAll(" nan ", " 0 ")
                               .replaceAll(" nan,", " 0,") +"\n";
                        fos.write(sCurrentLine.getBytes(), 0, 
sCurrentLine.getBytes().length);
                   }
               
                    //fos.write(fixedBytes, 0, fixedBytes.length);
                    
                    
                }}


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tika.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to