ch.javasoft.jsmat
Class MatOutputStreamWriter

java.lang.Object
  extended by ch.javasoft.jsmat.MatWriter<DataOutputStream>
      extended by ch.javasoft.jsmat.MatOutputStreamWriter

public class MatOutputStreamWriter
extends MatWriter<DataOutputStream>

The MatOutputStreamWriter writes a .mat file structure to a given OutputStream.

Note: Writing a file is more memory efficient with the MatFileWriter. This implementation uses byte array buffers to compute the block sizes before writing to the real output stream.


Field Summary
 
Fields inherited from class ch.javasoft.jsmat.MatWriter
mReservedWriter
 
Constructor Summary
MatOutputStreamWriter(OutputStream out)
          Constructor, writing data to the given output stream
 
Method Summary
 void close()
          Closes the underlying output stream
protected  VariableWriter createVariableWriter()
          Creates a writer for variable output.
protected  void initDataOutput(DataOutputStream dataOutput)
          No operation is performed here (no initialization needed)
 
Methods inherited from class ch.javasoft.jsmat.MatWriter
checkNoReservedWriter, createReservedWriter, createReservedWriter, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatOutputStreamWriter

public MatOutputStreamWriter(OutputStream out)
                      throws IOException
Constructor, writing data to the given output stream

Parameters:
out - the output stream to write to
Throws:
IOException - if any io exception occurs
Method Detail

initDataOutput

protected void initDataOutput(DataOutputStream dataOutput)
                       throws IOException
No operation is performed here (no initialization needed)

Specified by:
initDataOutput in class MatWriter<DataOutputStream>
Parameters:
dataOutput - the data output object to initialize
Throws:
IOException

createVariableWriter

protected VariableWriter createVariableWriter()
                                       throws IOException
Description copied from class: MatWriter
Creates a writer for variable output. Variables are written compressed, which needs some initialization executed when VariableWriter.open() is called. The same structures must be released again after writing the variable data, which is done in VariableWriter.close().

Specified by:
createVariableWriter in class MatWriter<DataOutputStream>
Throws:
IOException

close

public void close()
           throws IOException
Closes the underlying output stream

Specified by:
close in class MatWriter<DataOutputStream>
Throws:
IOException - if any io exception occurs