Code example for StringBufferInputStream

	public void testPipeThrown() { 
		final String data = "The quick brown fox jumped over the lazy dog";
		final IOException thrown = new IOException("test");
		StringBufferInputStream in = new StringBufferInputStream(data);
		OutputStream out = new OutputStream() {
			public void write(int b) throws IOException {
				throw thrown;
		FileUtil.Pipe pipe = new FileUtil.Pipe(in, out, 100l, true, true);;
		assertEquals("totalWritten", 0, pipe.totalWritten());
		assertTrue(thrown == pipe.getThrown());
	public void xtestPipeHalt() { // this test periodically fails on the build machine - 
									// disabling till we have time to figure out why 
Experience pair programming with AI  Get Codota for Java