code: @Override
      public void save(FileWriting output) throws IOException
      {
          final int widthInTile = map.getInTileWidth();
  
          // Header
          output.writeInteger(map.getTileWidth());
          output.writeInteger(map.getTileHeight());
          output.writeInteger(widthInTile);
          output.writeInteger(map.getInTileHeight());
  
          final boolean hasConfig = map.getMedia() != null;
          output.writeBoolean(hasConfig);
          if (hasConfig)
          {
              output.writeString(map.getMedia().getPath());
          }
  
          final int step = BLOC_SIZE;
          final int x = Math.min(step, widthInTile);
          final int t = (int) Math.ceil(widthInTile / (double) step);
  
          output.writeShort((short) t);
          for (int s = 0; s < t; s++)
          {
              final int count = countTiles(x, step, s);
              output.writeShort((short) count);
              saveTiles(output, Math.min(widthInTile, BLOC_SIZE), step, s);
          }
      }
docs: Save map to specified file as binary data. Data are saved this way (using specific types to save space):
  
  <pre>
  <code>(String)</code> sheets configuration file
  <code>(short)</code> width in tiles
  <code>(short)</code> height in tiles
  <code>(byte)</code> tile width (use of byte because tile width &lt; 255)
  <code>(byte)</code> tile height (use of byte because tile height &lt; 255)
  <code>(short)</code> number of {@value #BLOC_SIZE} horizontal blocs (widthInTile / {@value #BLOC_SIZE})
  for each blocs tile
  <code>(short)</code> number of tiles in this bloc
  for each tile in this bloc
  call tile.save(file)
  </pre>
  
  @param output The output level file.
  @throws IOException If error on writing.