Examples of UnicodeReader


Examples of org.fife.io.UnicodeReader

    }

    // Old local files and remote files, load 'em up.  UnicodeReader will
    // check for BOMs and handle them correctly in all cases, then pass
    // rest of stream down to InputStreamReader.
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), defaultEnc);

    // Remove listener so dirty flag doesn't get set when loading a file.
    Document doc = getDocument();
    doc.removeDocumentListener(this);
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null);
    } finally {
      doc.addDocumentListener(this);
      r.close();
    }

    // No IOException thrown, so we can finally change the location.
    charSet = ur.getEncoding();
    String old = getFileFullPath();
    this.loc = loc;
    setDirty(false);
    setCaretPosition(0);
    firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath());
View Full Code Here

Examples of org.fife.io.UnicodeReader

   *         occurs reading the file.
   * @see #isLocalAndExists()
   */
  public void reload() throws IOException {
    String oldEncoding = getEncoding();
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding);
    String encoding = ur.getEncoding();
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null); // Dumps old contents.
    } finally {
      r.close();
View Full Code Here

Examples of org.fife.io.UnicodeReader

    DocumentBuilder db = null;
    Document doc = null;
    try {
      db = dbf.newDocumentBuilder();
      //InputSource is = new InputSource(new FileReader(file));
      InputSource is = new InputSource(new UnicodeReader(
                new FileInputStream(file), FILE_ENCODING));
      is.setEncoding(FILE_ENCODING);
      doc = db.parse(is);//db.parse(file);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of org.fnlp.util.UnicodeReader

  }
 
  public SequenceReader(String file,boolean hasTarget, String charsetName) {
    this.hasTarget  = hasTarget;
    try {
      reader = new BufferedReader(new UnicodeReader(
          new FileInputStream(file), charsetName));
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of org.fnlp.util.UnicodeReader

    }
  }

  public SequenceReader(InputStream is) {

    reader = new BufferedReader(new UnicodeReader(
        is,null));
  }
View Full Code Here

Examples of org.fnlp.util.UnicodeReader

   * @param infile
   * @param outfile
   * @throws IOException
   */
  public static void processFile(String infile, String outfile,String delimer,int tagnum) throws IOException {
    BufferedReader in = new BufferedReader(new UnicodeReader(new FileInputStream(infile), "utf8"));
    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(
        outfile), "utf8"));
    String line = null;
    while ((line = in.readLine()) != null) {
      line = line.trim();
View Full Code Here

Examples of org.fnlp.util.UnicodeReader

    while(it.hasNext()){
      BufferedReader bfr =null;
      File file = it.next();
      try {
        FileInputStream in = new FileInputStream(file);
        bfr = new BufferedReader(new UnicodeReader(in,charset));
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
      FNLPDoc doc = new FNLPDoc();
      doc.name = file.getName();
View Full Code Here

Examples of org.fnlp.util.UnicodeReader

    while(it.hasNext()){
      BufferedReader bfr =null;
      File file = it.next();
      try {
        FileInputStream in = new FileInputStream(file);
        bfr = new BufferedReader(new UnicodeReader(in,charset));
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
      FNLPDoc doc = new FNLPDoc();
      doc.name = file.getName();
View Full Code Here

Examples of org.fnlp.util.UnicodeReader

    while(it.hasNext()){
      BufferedReader bfr =null;
      File file = it.next();
      try {
        FileInputStream in = new FileInputStream(file);
        bfr = new BufferedReader(new UnicodeReader(in,charset));
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
      FNLPDoc doc = new FNLPDoc();
      doc.name = file.getName();
View Full Code Here

Examples of org.yaml.snakeyaml.reader.UnicodeReader

        InputStream stream = null;

        try {
            stream = getInputStream();
            if (stream == null) throw new IOException("Stream is null!");
            read(yaml.load(new UnicodeReader(stream)));
        } catch (YAMLProcessorException e) {
            root = new LinkedHashMap<String, Object>();
        } finally {
            try {
                if (stream != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.