Replacement for StringBufferInputStream
Bug ID: 4217782 States that StringBufferInputStream is depreciated and should be replaced with StringReader, but StringReader is not an input stream. I frequently need to turn a String into a stream for testing, so I created this class:
<geshi lang="java5"> class StringReaderInputStream extends InputStream {
private final StringReader reader;
public StringReaderInputStream(String s) { reader = new StringReader(s); }
public int read() throws IOException { return reader.read(); }
} </geshi>