Package java.io

Examples of java.io.ObjectOutputStream.readObject()


          commandOptions.printUsage(true);
          throw new IllegalArgumentException("Missing model file option");
        }
        ObjectInputStream s =
          new ObjectInputStream(new FileInputStream(modelOption.value));
        crf = (CRF) s.readObject();
        s.close();
      }
      if (eval != null)
        test(new NoopTransducerTrainer(crf), eval, testData);
      else
View Full Code Here


          commandOptions.printUsage(true);
          throw new IllegalArgumentException("Missing model file option");
        }
        ObjectInputStream s =
          new ObjectInputStream(new FileInputStream(modelOption.value));
        crf = (CRF) s.readObject();
        s.close();
      }
      if (eval != null) {
        test(new NoopTransducerTrainer(crf), eval, testData);
      }
View Full Code Here

    }
   
    ByteArrayInputStream is=new ByteArrayInputStream(data);
    try{
      ObjectInputStream o = new ObjectInputStream(is);
      SettingsModel result= (SettingsModel)o.readObject();
      Assert.assertEquals(settingsModel.auditralColorMappings.size(), result.auditralColorMappings.size());
      Assert.assertEquals(settingsModel.auditralColorMappings.get(1).contextRegEx.getValue(), settingsModel.auditralColorMappings.get(1).contextRegEx.getValue());
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
View Full Code Here

    }
   
    ByteArrayInputStream is=new ByteArrayInputStream(data);
    try {
      ObjectInputStream o = new ObjectInputStream(is);
      AuditralColorMapping result= (AuditralColorMapping)o.readObject();
      Assert.assertEquals(auditralColorMapping.color.getValue().toString(), result.color.getValue().toString());
      Assert.assertEquals(auditralColorMapping.contextRegEx.getValue().toString(), result.contextRegEx.getValue().toString());
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
View Full Code Here

    settingsModelSingleton=defaultSettings;
    ByteArrayInputStream is=null;
    try{
      is = new ByteArrayInputStream(prefs.getByteArray(SETTINGS_KEY, defaultModelbytes));
      ObjectInputStream o = new ObjectInputStream(is);
      Object object= o.readObject();
      if (object instanceof SettingsModel){
        settingsModelSingleton = (SettingsModel)object;
      }
    } catch (Exception e) {
      logger.error("",e);
View Full Code Here

        s.flush();
      }
      { // Now restore it and look at the value.
        FileInputStream f = new FileInputStream("testing.tmp");
        ObjectInputStream s = new ObjectInputStream(f);
        SerialDemo d = (SerialDemo) s.readObject();

        System.out.println("SerialDemo.getVal() is: " + d.getVal());
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

          commandOptions.printUsage(true);
          throw new IllegalArgumentException("Missing model file option");
        }
        ObjectInputStream s =
          new ObjectInputStream(new FileInputStream(modelOption.value));
        crf = (CRF) s.readObject();
        s.close();
      }
      if (eval != null)
        test(new NoopTransducerTrainer(crf), eval, testData);
      else
View Full Code Here

          commandOptions.printUsage(true);
          throw new IllegalArgumentException("Missing model file option");
        }
        ObjectInputStream s =
          new ObjectInputStream(new FileInputStream(modelOption.value));
        crf = (CRF) s.readObject();
        s.close();
      }
      if (eval != null)
        test(new NoopTransducerTrainer(crf), eval, testData);
      else
View Full Code Here

          commandOptions.printUsage(true);
          throw new IllegalArgumentException("Missing model file option");
        }
        ObjectInputStream s =
          new ObjectInputStream(new FileInputStream(modelOption.value));
        crf = (CRF) s.readObject();
        s.close();
      }
      if (eval != null)
        test(new NoopTransducerTrainer(crf), eval, testData);
      else
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.