public synchronized Map < String , MLArray > read ( InputStream stream , MatFileFilter filter ) throws IOException { this . filter = filter ; data . clear ( ) ; ByteBuffer buf = null ; final ByteArrayOutputStream2 baos = new ByteArrayOutputStream2 ( ) ; copy ( stream , baos ) ; buf = ByteBuffer . wrap ( baos . getBuf ( ) , 0 , baos . getCount ( ) ) ; // Do the actual work parseData ( buf ) ; return getContent ( ) ; }
Read a mat file from a stream . Internally this will read the stream fully into memory before parsing it .