ISMatTag tag = new ISMatTag(buf); switch ( tag.type )
public ISMatTag(ByteBuffer buf) throws IOException { //must call parent constructor super(0,0); int tmp = buf.getInt(); //data not packed in the tag if ( tmp >> 16 == 0 ) { type = tmp; size = buf.getInt(); compressed = false; } else //data _packed_ in the tag (compressed) { size = tmp >> 16; // 2 more significant bytes type = tmp & 0xffff; // 2 less significant bytes; compressed = true; } padding = getPadding(size, compressed); mfis = new MatFileInputStream(buf, type); }
public char[] readToCharArray() throws IOException { // allocate memory for array elements int elements = size / sizeOf(); char[] ac = new char[elements]; MatFileInputStream mfis = new MatFileInputStream(buf, type); for (int i = 0; i < elements; i++) { ac[i] = mfis.readChar(); } // skip padding if (padding > 0) { buf.position(buf.position() + padding); } return ac; } }
new ISMatTag(buf); int maxlen = buf.getInt(); //maximum field length tag = new ISMatTag(buf); tag = new ISMatTag(buf); MLCell cell = new MLCell(name, dims, type, attributes); for (int i = 0; i < cell.getM() * cell.getN(); i++) { tag = new ISMatTag(buf); if (tag.size > 0) { tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray);
tag = new ISMatTag(buf); int maxlen = buf.getInt(); //maximum field length tag = new ISMatTag(buf); tag = new ISMatTag(buf); tag = new ISMatTag(buf); if ( tag.size > 0 ) tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray );
new ISMatTag(buf); int maxlen = buf.getInt(); //maximum field length tag = new ISMatTag(buf); tag = new ISMatTag(buf); MLCell cell = new MLCell(name, dims, type, attributes); for (int i = 0; i < cell.getM() * cell.getN(); i++) { tag = new ISMatTag(buf); if (tag.size > 0) { tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray);
tag = new ISMatTag(buf); int maxlen = buf.getInt(); // maximum field length tag = new ISMatTag(buf); tag = new ISMatTag(buf); if (tag.size > 0) { MLArray fieldValue = readMatrix(buf, false); MLCell cell = new MLCell(name, dims, type, attributes); for (int i = 0; i < cell.getM() * cell.getN(); i++) { tag = new ISMatTag(buf); if (tag.size > 0) { tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray) .getRealByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray) .getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray) .getRealByteBuffer(), (MLNumericArray<?>) mlArray); tag = new ISMatTag(buf); tag.readToByteBuffer(((MLNumericArray<?>) mlArray) .getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray);
tag = new ISMatTag(buf); int maxlen = buf.getInt(); //maximum field length tag = new ISMatTag(buf); tag = new ISMatTag(buf); tag = new ISMatTag(buf); if ( tag.size > 0 ) tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getImaginaryByteBuffer(), (MLNumericArray<?>) mlArray ); tag = new ISMatTag(buf); tag.readToByteBuffer( ((MLNumericArray<?>) mlArray).getRealByteBuffer(), (MLNumericArray<?>) mlArray );
ISMatTag tag = new ISMatTag(buf); switch (tag.type) { case MatDataTypes.miCOMPRESSED:
ISMatTag tag = new ISMatTag(buf); switch ( tag.type )
ISMatTag tag = new ISMatTag(buf); switch (tag.type) { case MatDataTypes.miCOMPRESSED:
ISMatTag tag = new ISMatTag(buf); switch (tag.type) { case MatDataTypes.miCOMPRESSED:
public ISMatTag(ByteBuffer buf) throws IOException { //must call parent constructor super(0,0); int tmp = buf.getInt(); //data not packed in the tag if ( tmp >> 16 == 0 ) { type = tmp; size = buf.getInt(); compressed = false; } else //data _packed_ in the tag (compressed) { size = tmp >> 16; // 2 more significant bytes type = tmp & 0xffff; // 2 less significant bytes; compressed = true; } padding = getPadding(size, compressed); mfis = new MatFileInputStream(buf, type); }
public ISMatTag(ByteBuffer buf) throws IOException { // must call parent constructor super(0, 0); this.buf = buf; int tmp = buf.getInt(); // data not packed in the tag if (tmp >> 16 == 0) { type = tmp; size = buf.getInt(); compressed = false; } else // data _packed_ in the tag (compressed) { size = tmp >> 16; // 2 more significant bytes type = tmp & 0xffff; // 2 less significant bytes; compressed = true; } padding = getPadding(size, compressed); }
public ISMatTag(ByteBuffer buf) throws IOException { //must call parent constructor super(0, 0); int tmp = buf.getInt(); //data not packed in the tag if (tmp >> 16 == 0) { type = tmp; size = buf.getInt(); compressed = false; } else { //data _packed_ in the tag (compressed) size = tmp >> 16; // 2 more significant bytes type = tmp & 0xffff; // 2 less significant bytes; compressed = true; } padding = getPadding(size, compressed); mfis = new MatFileInputStream(buf, type); }
public ISMatTag(ByteBuffer buf) throws IOException { //must call parent constructor super(0, 0); int tmp = buf.getInt(); //data not packed in the tag if (tmp >> 16 == 0) { type = tmp; size = buf.getInt(); compressed = false; } else { //data _packed_ in the tag (compressed) size = tmp >> 16; // 2 more significant bytes type = tmp & 0xffff; // 2 less significant bytes; compressed = true; } padding = getPadding(size, compressed); mfis = new MatFileInputStream(buf, type); }
/** * Reads Matrix name. * * Modifies <code>buf</code> position. * * @param buf * <code>ByteBuffer</code> * @return name <code>String</code> * @throws IOException * if reading from buffer fails */ private String readName(ByteBuffer buf) throws IOException { String s; ISMatTag tag = new ISMatTag(buf); char[] ac = tag.readToCharArray(); s = new String(ac); return s; }
/** * Reads Matrix flags. * * Modifies <code>buf</code> position. * * @param buf <code>ByteBuffer</code> * @return flags int array * @throws IOException if reading from buffer fails */ private int[] readFlags(ByteBuffer buf) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] flags = tag.readToIntArray(); return flags; } /**
/** * Reads Matrix dimensions. * * Modifies <code>buf</code> position. * * @param buf * <code>ByteBuffer</code> * @return dimensions int array * @throws IOException * if reading from buffer fails */ private int[] readDimension(ByteBuffer buf) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] dims = tag.readToIntArray(); return dims; }
/** * Reads Matrix dimensions. * * Modifies <code>buf</code> position. * * @param buf <code>ByteBuffer</code> * @return dimensions int array * @throws IOException if reading from buffer fails */ private int[] readDimension(ByteBuffer buf ) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] dims = tag.readToIntArray(); return dims; } /**