public boolean comprobarArticuloExistente(Articulo art) { boolean existe = false; if (FICHERO.exists()) { try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(FICHERO))) { while (true) { Articulo articuloActual = (Articulo) ois.readObject(); if (articuloActual.getId() == art.getId() && articuloActual.getNombre().equals(art.getNombre()) && articuloActual.getPrecio() == art.getPrecio() && articuloActual.getCantAlmacen() == art.getCantAlmacen()) { existe = true; } } } catch (ClassNotFoundException e) { } catch (EOFException e) { } catch (IOException e) { } } return existe; }