Code example for StringBufferInputStream

0
	} 
 
	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);
		pipe.run();
		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 
		final long MAX = 1000000;