code: public void flush() throws IOException {
          
          final ByteBuffer data = ByteBuffer.allocate(
                  getCapacity() * FatDirectoryEntry.SIZE + (volumeLabel != null ? FatDirectoryEntry.SIZE : 0));
          
          for (FatDirectoryEntry entry : this.entries) {
              if (entry != null) {
                  entry.write(data);
              }
          }
          
          /* TODO: the label could be placed directly the dot entries */
          
          if (this.volumeLabel != null) {
              final FatDirectoryEntry labelEntry =
                      FatDirectoryEntry.createVolumeLabel(type, volumeLabel);
  
              labelEntry.write(data);
          }
          
          if (data.hasRemaining()) {
              FatDirectoryEntry.writeNullEntry(data);
          }
  
          data.flip();
          
          write(data);
          resetDirty();
      }
docs: Flush the contents of this directory to the persistent storage