{
      InputStreamReader reader = new InputStreamReader(new FileInputStream(temporaryFileName), "UTF8");
      for (int length = reader.read(outputchars, 0, outputchars.length); length > 0; length = reader.read(
        outputchars,
        0,
        outputchars.length))
      {
        os.write(outputchars, 0, length);
        count += length;
        if (count > flushThreshold)
        {
          os.flush();
          count = 0;
        }
      }
      reader.close();
      new File(temporaryFileName).delete();
    }