Java ObjectOutputStream Write LoadMatFromFile(double[] mat, String filename)

Here you can find the source of LoadMatFromFile(double[] mat, String filename)

Description

Load Mat From File

License

Open Source License

Declaration

public static void LoadMatFromFile(double[] mat, String filename) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

public class Main {
    public static void LoadMatFromFile(double[] mat, String filename) {
        try {//w  w  w  . j  av  a 2  s  .c o  m
            java.io.FileInputStream fis = new java.io.FileInputStream(filename);
            java.io.ObjectInputStream inStream = new java.io.ObjectInputStream(fis);
            for (int i = 0; i < mat.length; i++)
                mat[i] = inStream.readDouble();
            inStream.close();
            inStream.close();
        } catch (IOException e) {
            System.out.println("SaveMatToFile: Caught IOException when trying to write to file: " + e.getMessage());
            System.exit(-1);
        }
    }
}

Related

  1. load(String path)
  2. loadAllPlaying(String path)
  3. loadData(Class expectedClass, String filename)
  4. loadData(HashMap data, String filename)
  5. loadGZipObject(File file)
  6. loadObj(String file)
  7. loadSerializableFile(File file)
  8. loadSerialized(File file)
  9. loadSerializedObject(String fileName)