mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
more classpath progress
This commit is contained in:
22
classpath/java/io/InputStreamReader.java
Normal file
22
classpath/java/io/InputStreamReader.java
Normal file
@ -0,0 +1,22 @@
|
||||
package java.io;
|
||||
|
||||
public class InputStreamReader extends Reader {
|
||||
private final InputStream in;
|
||||
|
||||
public InputStreamReader(InputStream in) {
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
public int read(char[] b, int offset, int length) throws IOException {
|
||||
byte[] buffer = new byte[length];
|
||||
int c = in.read(buffer);
|
||||
for (int i = 0; i < c; ++i) {
|
||||
b[i + offset] = (char) buffer[i];
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
in.close();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user