@Override public synchronized void close() throws IOException { if (!isOpen) { return; } if (out != null) { out.close(); } if (in != null) { in.close(); } this.isOpen = false; }
public final void save(File target) { if (target == null) { throw new IllegalArgumentException("A reflected cannot be saved without a valid file!"); } O os = null; try { os = getCodec().newOutput(target); this.save(os); this.onSaved(target); } catch (IOException e) { throw new InvalidReflectedObjectException("File to save into cannot be accessed!", e); } finally { if (os != null) { try { os.close(); } catch (IOException e) { Reflector.LOGGER.log(WARNING, "Failed to close the output stream", e); } } } }