more classpath progress

This commit is contained in:
Joel Dice
2007-07-28 19:29:01 -06:00
parent c96a4a5b39
commit a9e10d1c7f
22 changed files with 550 additions and 13 deletions

View File

@ -0,0 +1,23 @@
package java.io;
public class StringReader extends Reader {
private final String in;
private int position = 0;
public StringReader(String in) {
this.in = in;
}
public int read(char[] b, int offset, int length) throws IOException {
if (length > in.length() - position) {
length = in.length() - position;
if (length <= 0) {
return -1;
}
}
in.getChars(position, length, b, offset);
return length;
}
public void close() throws IOException { }
}