title: Memory mapped files in java
body: <p>I was reading the <a href="https://rads.stackoverflow.com/amzn/click/com/0596002882" rel="nofollow noreferrer" rel="nofollow noreferrer">book</a> and it has got the below lines:</p>
  
  <blockquote>
    <p>A <code>MemoryMappedBuffer</code> directly reflects the disk file with which it
    is associated. If the file is structurally modified while the mapping
    is in effect, strange behavior can result (exact behaviors are, of
    course, operating system- and filesystem-dependent). A
    <code>MemoryMappedBuffer</code> has a fixed size, but the file it's mapped to is
    elastic. Specifically, if a file's size changes while the mapping is
    in effect, some or all of the buffer may become inaccessible,
    undefined data could be returned, or unchecked exceptions could be
    thrown.</p>
  </blockquote>
  
  <p>So my questions are:</p>
  
  <ul>
  <li>Can't i append text to the files which i have already mapped. If yes then how?</li>
  <li>Can somebody please guide me what are the real use cases of memory mapped file and would be great if you can mention what specific problem you have solved by this.</li>
  </ul>
  
  <p>Please bear with me if the questions are pretty naive. Thanks. </p>