Writes MATRIX flags into OutputStream . @param os - OutputStream @param array - a MLArray @throws IOException
(DataOutputStream os, MLArray array)
| 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>. |
no test coverage detected