summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java
blob: 779ffa2eca0296e4dd0d0d15966d2a9732524224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*******************************************************************************
 * Copyright (c) 2013 Intel Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Ioana Grigoropol(Intel) - initial API and implementation
 *******************************************************************************/
package org.yocto.bc.remote.utils;

import java.io.IOException;
import java.io.Writer;

public class ConsoleWriter extends Writer {

	private StringBuffer sb;

	public ConsoleWriter() {
		sb = new StringBuffer();
	}

	@Override
	public void close() throws IOException {
	}

	public String getContents() {
		return sb.toString();
	}

	@Override
	public void flush() throws IOException {
	}

	@Override
	public void write(char[] cbuf, int off, int len) throws IOException {
		sb.append(cbuf);
	}

	@Override
	public void write(String str) throws IOException {
		sb.append(str);
	}

}