Package java.io

Examples of java.io.ObjectInputStream.readObject()


      logger.log(BasicLevel.DEBUG, "loadobj, after load call");

    ByteArrayInputStream bis = new ByteArrayInputStream(content);
    ObjectInputStream ois = new ObjectInputStream(bis);
    try {
      Object obj = ois.readObject();
      return obj;
    } catch (Exception e) {
      String exceptionString = e.toString();
      if (exceptionString.indexOf("KNOWN PROBLEM") == -1)
      {
View Full Code Here


    }

    ObjectInputStream ois = null;
    try {
      ois = new ObjectInputStream(new FileInputStream(attachmentsStore));
      return expected.cast(ois.readObject());
    } finally {
      if (ois != null) {
        ois.close();
      }
    }
View Full Code Here

      int returnVal = m_FileChooser.showOpenDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
  File selected = m_FileChooser.getSelectedFile();
  try {
    ObjectInputStream oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(selected)));
    Object obj = oi.readObject();
    oi.close();
    if (!m_ClassType.isAssignableFrom(obj.getClass())) {
      throw new Exception("Object not of type: " + m_ClassType.getName());
    }
    return obj;
View Full Code Here

    }

    if (objectInputFileName.length() != 0) {
      // Load classifier from file
      if (objectInputStream != null) {
        classifier = (Classifier) objectInputStream.readObject();
        // try and read a header (if present)
        Instances savedStructure = null;
        try {
          savedStructure = (Instances) objectInputStream.readObject();
        } catch (Exception ex) {
View Full Code Here

      if (objectInputStream != null) {
        classifier = (Classifier) objectInputStream.readObject();
        // try and read a header (if present)
        Instances savedStructure = null;
        try {
          savedStructure = (Instances) objectInputStream.readObject();
        } catch (Exception ex) {
          // don't make a fuss
        }
        if (savedStructure != null) {
          // test for compatibility with template
View Full Code Here

      // load file
      tempFile = (File) m_UndoList.get(m_UndoList.size() - 1);
      try {
        // read serialized data
        ooi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(tempFile)));
        inst = (Instances) ooi.readObject();
        ooi.close();
       
        // set instances
        setInstances(inst);
        notifyListener(new TableModelEvent(this, TableModelEvent.HEADER_ROW));
View Full Code Here

    float d[] = null;
    ObjectInputStream in = null;

    try {
      in = new ObjectInputStream(getClass().getClassLoader().getResourceAsStream("d16.ser"));
      d = (float[]) in.readObject();
    }
    catch (Exception e) {
      System.out.println("2 couldn't load the array for the SynthesisFilter ");
      System.exit(1);
    }
View Full Code Here

  int array[][]=null;

  try{
    in = new ObjectInputStream(getClass().getClassLoader().getResourceAsStream("huffman.ser"));
    ht = new HuffmanTables[HTN];
    array = (int[][])in.readObject();
    ht[0] = new HuffmanTables("0  ", 0, 0, 0, 0, -1,  array, 0);
    array = (int[][])in.readObject();
    ht[1] = new HuffmanTables("1  ", 2, 2, 0, 0, -1,   array, 7);
    array = (int[][])in.readObject();
    ht[2] = new HuffmanTables("2  ", 3, 3, 0, 0, -1,   array, 17);
View Full Code Here

  try{
    in = new ObjectInputStream(getClass().getClassLoader().getResourceAsStream("huffman.ser"));
    ht = new HuffmanTables[HTN];
    array = (int[][])in.readObject();
    ht[0] = new HuffmanTables("0  ", 0, 0, 0, 0, -1,  array, 0);
    array = (int[][])in.readObject();
    ht[1] = new HuffmanTables("1  ", 2, 2, 0, 0, -1,   array, 7);
    array = (int[][])in.readObject();
    ht[2] = new HuffmanTables("2  ", 3, 3, 0, 0, -1,   array, 17);
    array = (int[][])in.readObject();
    ht[3] = new HuffmanTables("3  ", 3, 3, 0, 0, -1,   array, 17);
View Full Code Here

    ht = new HuffmanTables[HTN];
    array = (int[][])in.readObject();
    ht[0] = new HuffmanTables("0  ", 0, 0, 0, 0, -1,  array, 0);
    array = (int[][])in.readObject();
    ht[1] = new HuffmanTables("1  ", 2, 2, 0, 0, -1,   array, 7);
    array = (int[][])in.readObject();
    ht[2] = new HuffmanTables("2  ", 3, 3, 0, 0, -1,   array, 17);
    array = (int[][])in.readObject();
    ht[3] = new HuffmanTables("3  ", 3, 3, 0, 0, -1,   array, 17);
    array = (int[][])in.readObject();
    ht[4] = new HuffmanTables("4  ", 0, 0, 0, 0, -1,   array, 0);
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.