Permalink
Browse files

classpath: Closeable & Flushable

  • Loading branch information...
1 parent 33fed1b commit be952acbcbeadf041c73d19a6ecac7ac72d21ac2 Pierre Carrier committed Nov 4, 2012
@@ -0,0 +1,16 @@
+/* Copyright (c) 2012, Avian Contributors
+
+ Permission to use, copy, modify, and/or distribute this software
+ for any purpose with or without fee is hereby granted, provided
+ that the above copyright notice and this permission notice appear
+ in all copies.
+
+ There is NO WARRANTY for this software. See license.txt for
+ details. */
+
+package java.io;
+
+public interface Closeable {
+ void close()
+ throws IOException;
+}
@@ -0,0 +1,16 @@
+/* Copyright (c) 2012, Avian Contributors
+
+ Permission to use, copy, modify, and/or distribute this software
+ for any purpose with or without fee is hereby granted, provided
+ that the above copyright notice and this permission notice appear
+ in all copies.
+
+ There is NO WARRANTY for this software. See license.txt for
+ details. */
+
+package java.io;
+
+public interface Flushable {
+ void flush()
+ throws IOException;
+}
@@ -10,7 +10,7 @@
package java.io;
-public abstract class InputStream {
+public abstract class InputStream implements Closeable {
public abstract int read() throws IOException;
public int read(byte[] buffer) throws IOException {
@@ -10,7 +10,7 @@
package java.io;
-public abstract class OutputStream {
+public abstract class OutputStream implements Closeable, Flushable {
public abstract void write(int c) throws IOException;
public void write(byte[] buffer) throws IOException {
@@ -10,7 +10,7 @@
package java.io;
-public abstract class Reader {
+public abstract class Reader implements Closeable {
public int read() throws IOException {
char[] buffer = new char[1];
int c = read(buffer);
@@ -10,7 +10,7 @@
package java.io;
-public abstract class Writer {
+public abstract class Writer implements Closeable, Flushable {
public void write(int c) throws IOException {
char[] buffer = new char[] { (char) c };
write(buffer);

0 comments on commit be952ac

Please sign in to comment.