Examples of FileInputStream


Examples of java.io.FileInputStream

 
  protected static void processGUIEditorsProps(File propsFile) {
    GenericObjectEditor.registerEditors();
    try {
      Properties editorProps = new Properties();
      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(propsFile));
      editorProps.load(bi);
      bi.close();
      bi = null;
     
      Enumeration enm = editorProps.propertyNames();
View Full Code Here

Examples of java.io.FileInputStream

      int[] ignoredAtts = null;

      m_Log.statusMessage("Loading model from file...");

      try {
  InputStream is = new FileInputStream(selected);
  if (selected.getName().endsWith(".gz")) {
    is = new GZIPInputStream(is);
  }
  ObjectInputStream objectInputStream = new ObjectInputStream(is);
  clusterer = (Clusterer) objectInputStream.readObject();
View Full Code Here

Examples of java.io.FileInputStream

    else
      newInst = new double[2];       
    File txt = new File(directoryPath + File.separator + subdirPath + File.separator + files[j]);
    BufferedReader is;
    if (m_charSet == null || m_charSet.length() == 0) {
      is = new BufferedReader(new InputStreamReader(new FileInputStream(txt)));
    } else {
      is = new BufferedReader(new InputStreamReader(new FileInputStream(txt), m_charSet));
    }
    StringBuffer txtStr = new StringBuffer();
    int c;
    while ((c = is.read()) != -1) {
      txtStr.append((char) c);
View Full Code Here

Examples of java.io.FileInputStream

        Sink<Quad> noWhere = new SinkNull<Quad>() ;

        // ---- Parse to a Sink.
        // RIOT controls the conversion from bytes to java chars.
        InputStream in = new FileInputStream("data.trig") ;
       
        RiotReader.parseQuads(in, Lang.TRIG, "http://example/base", noWhere) ;
       
       
        // --- Or create a parser and do the parsing as separate steps.
        String baseURI = "http://example/base" ;
           
        in = new FileInputStream("data.trig") ;
        LangRIOT parser = RiotReader.createParserQuads(in, Lang.TRIG, "http://example/base", noWhere) ;
       
        // Parser to first error or warning.
        ErrorHandler errHandler = ErrorHandlerFactory.errorHandlerStrict ;
View Full Code Here

Examples of java.io.FileInputStream

          }
        } /* binary */ else {

          ObjectInputStream is =
            new ObjectInputStream(new BufferedInputStream(
                                                          new FileInputStream(loadFrom)));
          // try and read the model
          temp = (weka.classifiers.Classifier)is.readObject();
          // try and read the header (if present)
          try {
            tempHeader = (Instances)is.readObject();
View Full Code Here

Examples of java.io.FileInputStream

        usage();
      }
    }
    else
    {
          Player player = new Player(new BufferedInputStream(new FileInputStream(file), 2048));
          System.out.println("starting");
          player.play();
          System.out.println("ending");
    }
      }
View Full Code Here

Examples of java.io.FileInputStream

     * @throws org.apache.axis2.AxisFault if an error occurs
     */
    private void createPriorityConfiguration(String fileName) throws AxisFault {
        OMElement definitions = null;
        try {
            FileInputStream fis = new FileInputStream(fileName);
            definitions = new StAXOMBuilder(fis).getDocumentElement();
            definitions.build();
        } catch (FileNotFoundException e) {
            handleException("Priority configuration file cannot be found : " + fileName, e);
        } catch (XMLStreamException e) {
View Full Code Here

Examples of java.io.FileInputStream

    ObjectInputStream in=null;
   
    try {
      File programConfigFile = new File(Settings.getUserSettingsDirName(),"programConfigurations.dat");
     
      in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(programConfigFile), 0x1000));
     
      in.readInt(); // read version
     
      mAvailableProgramConfigurations = new GlobalPluginProgramFormating[in.readInt()];
     
View Full Code Here

Examples of java.io.FileInputStream

  private void loadServiceSettings(TvDataServiceProxy service) {
    File f=new File(Settings.getUserSettingsDirName(),service.getId()+".service");
    if (f.exists()) {
      try {
        Properties p=new Properties();
        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f), 0x1000);
        p.load(in);
        in.close();
        service.loadSettings(p);
      } catch (IOException exc) {
        String msg = mLocalizer.msg("error.3", "Loading settings for plugin {0} failed!\n({1})",
View Full Code Here

Examples of java.io.FileInputStream

        file = new File(dir, name);
      } else {
        File parentDir = new File(dir, dirName);
        file = new File(parentDir, name);
      }
      FileInputStream fis = new FileInputStream(file);
      byte[] buf = new byte[(int) file.length()];
      for (int nb=0; nb<buf.length; ) {
        int ret = fis.read(buf, nb, buf.length-nb);
        if (ret == -1) throw new EOFException();
        nb += ret;
      }
      fis.close();

      nbloaded += 1;   
      return buf;
  }
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.