Skip to content
vkostyukov edited this page Feb 11, 2013 · 2 revisions

All la4j entities (including matrices, vectors, factories, linear systems and etc) can be serializated and deserializated dirrectly through java.io.ObjectOutputStream and java.io.ObjectInputStream classes.

Serialization:

Matrix a = new Basic2DMatrix(...);
OutputStream out = new ObjectOutputStream(FileOutputStream("matrix.bin"));
out.writeObject(a);
out.close();

Deserialization:

InputStream in = new ObjectInputStream(FileInputStream("matrix.bin"));
Matrix a = (Matrix) in.readObject();
in.close();
Clone this wiki locally