Code example for StringBufferInputStream

0
		} 
		checkPipe(sb.toString());
	} 
 
	void checkPipe(String data) {
		StringBufferInputStream in = new StringBufferInputStream(data);
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		FileUtil.Pipe pipe = new FileUtil.Pipe(in, out, 100l, true, true);
		pipe.run();
		assertTrue(data.equals(out.toString()));
		assertTrue(null == pipe.getThrown());
		assertEquals("totalWritten", data.length(), pipe.totalWritten());
	} 
 
	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;