package testutil; import java.io.*; public class TestUtilities { public static InputStream createInputStreamFromString(String string) { return new ByteArrayInputStream(string.getBytes()); } public static InputStream createIOExceptionThrowingInputStream() { return new InputStream() { public int read() throws IOException { throw new IOException("test IOException"); } }; } }