code: public void writeTo(OutputStream out) throws IOException, RepositoryException {
          mStoredLayout.writeTo(out);
  
          Cursor <StoredLayoutProperty> cursor = mLayoutFactory.mPropertyStorage
              .query("layoutID = ?")
              .with(mStoredLayout.getLayoutID())
              .fetch();
  
          try {
              while (cursor.hasNext()) {
                  StoredLayoutProperty prop = cursor.next();
                  // Write 1 to indicate that this was not the last property.
                  out.write(1);
                  prop.writeTo(out);
              }
          } finally {
              cursor.close();
          }
  
          out.write(0);
      }
docs: Write a layout to be read by {@link LayoutFactory#readLayoutFrom}.
  
  @since 1.2.2