code: private void writeDimensions(DataOutputStream os, MLArray array) throws IOException
      {
          ByteArrayOutputStream buffer = new ByteArrayOutputStream();
          DataOutputStream bufferDOS = new DataOutputStream(buffer);
          
          int[] dims = array.getDimensions();
          for ( int i = 0; i < dims.length; i++ )
          {
              bufferDOS.writeInt(dims[i]);
          }
          OSArrayTag tag = new OSArrayTag(MatDataTypes.miINT32, buffer.toByteArray() );
          tag.writeTo( os );
          
      }
docs: Writes MATRIX dimensions into <code>OutputStream</code>.
  
  @param os - <code>OutputStream</code>
  @param array - a <code>MLArray</code>
  @throws IOException