mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
classpath: Closeable & Flushable
This commit is contained in:
parent
33fed1b710
commit
be952acbcb
16
classpath/java/io/Closeable.java
Normal file
16
classpath/java/io/Closeable.java
Normal file
@ -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;
|
||||||
|
}
|
16
classpath/java/io/Flushable.java
Normal file
16
classpath/java/io/Flushable.java
Normal file
@ -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;
|
package java.io;
|
||||||
|
|
||||||
public abstract class InputStream {
|
public abstract class InputStream implements Closeable {
|
||||||
public abstract int read() throws IOException;
|
public abstract int read() throws IOException;
|
||||||
|
|
||||||
public int read(byte[] buffer) throws IOException {
|
public int read(byte[] buffer) throws IOException {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
package java.io;
|
package java.io;
|
||||||
|
|
||||||
public abstract class OutputStream {
|
public abstract class OutputStream implements Closeable, Flushable {
|
||||||
public abstract void write(int c) throws IOException;
|
public abstract void write(int c) throws IOException;
|
||||||
|
|
||||||
public void write(byte[] buffer) throws IOException {
|
public void write(byte[] buffer) throws IOException {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
package java.io;
|
package java.io;
|
||||||
|
|
||||||
public abstract class Reader {
|
public abstract class Reader implements Closeable {
|
||||||
public int read() throws IOException {
|
public int read() throws IOException {
|
||||||
char[] buffer = new char[1];
|
char[] buffer = new char[1];
|
||||||
int c = read(buffer);
|
int c = read(buffer);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
package java.io;
|
package java.io;
|
||||||
|
|
||||||
public abstract class Writer {
|
public abstract class Writer implements Closeable, Flushable {
|
||||||
public void write(int c) throws IOException {
|
public void write(int c) throws IOException {
|
||||||
char[] buffer = new char[] { (char) c };
|
char[] buffer = new char[] { (char) c };
|
||||||
write(buffer);
|
write(buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user