code: public void write(ObjectWriter out, AccessControlList acl) throws IOException
     {
        // write id
        out.writeInt(SerializationConstants.ACCESS_CONTROL_LIST);
  
        // Writing owner
        String owner = acl.getOwner();
        if (owner != null)
        {
           out.writeByte(SerializationConstants.NOT_NULL_DATA);
           out.writeString(owner);
        }
        else
        {
           out.writeByte(SerializationConstants.NULL_DATA);
        }
  
        // writing access control entries size
        List<AccessControlEntry> accessList = acl.getPermissionEntries();
        out.writeInt(accessList.size());
  
        for (AccessControlEntry entry : accessList)
        {
           // writing access control entrys identity
           out.writeString(entry.getIdentity());
           // writing permission
           out.writeString(entry.getPermission());
        }
     }
docs: Write AccessControlList data.
  
  @param out
  The ObjectWriter
  @param acl
  The AccessControlList object
  @throws IOException
  If an I/O error has occurred.