MCPcopy Create free account
hub / github.com/diffplug/matfilerw / writeFlags

Method writeFlags

src/main/java/com/jmatio/io/MatFileWriter.java:473–487  ·  view source on GitHub ↗

Writes MATRIX flags into OutputStream . @param os - OutputStream @param array - a MLArray @throws IOException

(DataOutputStream os, MLArray array)

Source from the content-addressed store, hash-verified

471 * @throws IOException
472 */
473 private void writeFlags(DataOutputStream os, MLArray array) throws IOException {
474 ByteArrayOutputStream buffer = new ByteArrayOutputStream();
475 DataOutputStream bufferDOS = new DataOutputStream(buffer);
476
477 bufferDOS.writeInt(array.getFlags());
478
479 if (array.isSparse()) {
480 bufferDOS.writeInt(((MLSparse) array).getMaxNZ());
481 } else {
482 bufferDOS.writeInt(0);
483 }
484 OSArrayTag tag = new OSArrayTag(MatDataTypes.miUINT32, buffer.toByteArray());
485 tag.writeTo(os);
486
487 }
488
489 /**
490 * Writes MATRIX dimensions into <code>OutputStream</code>.

Callers 1

writeMatrixMethod · 0.95

Calls 4

writeToMethod · 0.95
getFlagsMethod · 0.80
isSparseMethod · 0.80
getMaxNZMethod · 0.80

Tested by

no test coverage detected