title: Delete data random access file in Java
body: <p>I'm creating a phonebook, which stores contact information and an array of phones of every contact. I'm using a randomaccessfile, mi function to store the data is: </p>
  
  <pre><code> public void writeRand(String name, People other, int tam) {
          RandomAccessFile file;
          try {
              file= new RandomAccessFile(name, "rw");
              file.seek(file.length());
              file.writeInt(other.getCount());
              file.writeUTF(other.getName());
              file.writeUTF(other.getAddress());
              file.writeUTF(other.getMail());
              archivo.writeUTF(other.getDate());
              for (int i = 0; i &lt; tam; i++) {
                  file.writeUTF(other.getPhones()[i]);
                  file.writeBoolean(other.getPT()[i]);
                  file.writeBoolean(other.getMF()[i]);
              }
              file.writeUTF(other.getNotes());
              file.writeUTF(other.getState());
              file.close();
          } catch (FileNotFoundException ex) {
              Logger.getLogger(file.class.getName()).log(Level.SEVERE, null, ex);
          } catch (IOException ex) {
              Logger.getLogger(file.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  </code></pre>
  
  <p>That is the structure that I use to store data for each contact, I should mention that the arrays that are stored can have different dimensions in each contact.</p>
  
  <p>The real question is how to create a function that allows me to delete a entire contact?</p>