+ if (!closed) {\r
+ super.flush();\r
+ super.getChannel().force(true);\r
+ log.debug("Marking Lockedoutputstream closed.");\r
+ } else\r
+ throw new IOException("Close on already closed FileOutputStream.");\r
+ closed=true;\r
+ }\r
+\r
+\r
+ /**\r
+ * @throws IOException\r
+ * @see java.io.OutputStream#flush()\r
+ */\r
+ public void flush() throws IOException {\r
+ if (!closed)\r
+ super.flush();\r
+ else\r
+ throw new IOException("flush on closed FileOutputStream");\r
+ }\r
+\r
+ /**\r
+ * @return\r
+ * @see java.io.FileOutputStream#getChannel()\r
+ */\r
+ public FileChannel getChannel() {\r
+ if (!closed)\r
+ return super.getChannel();\r
+ else\r
+ return null;\r
+ }\r
+\r
+\r
+\r
+ /**\r
+ * @param b\r
+ * @param off\r
+ * @param len\r
+ * @throws IOException\r
+ * @see java.io.FileOutputStream#write(byte[], int, int)\r
+ */\r
+ public void write(byte[] b, int off, int len) throws IOException {\r
+ if (!closed)\r
+ super.write(b, off, len);\r
+ else\r
+ throw new IOException("write on Closed FileOutputStream");\r
+ }\r
+\r
+ /**\r
+ * @param b\r
+ * @throws IOException\r
+ * @see java.io.FileOutputStream#write(byte[])\r
+ */\r
+ public void write(byte[] b) throws IOException {\r
+ if (!closed)\r
+ super.write(b);\r
+ else\r
+ throw new IOException("write on Closed FileOutputStream");\r
+ }\r
+\r
+ /**\r
+ * @param b\r
+ * @throws IOException\r
+ * @see java.io.FileOutputStream#write(int)\r
+ */\r
+ public void write(int b) throws IOException {\r
+ if (!closed)\r
+ super.write(b);\r
+ else\r
+ throw new IOException("write on Closed FileOutputStream");\r