summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java')
-rw-r--r--plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java
new file mode 100644
index 0000000..779ffa2
--- /dev/null
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/ConsoleWriter.java
@@ -0,0 +1,46 @@
1/*******************************************************************************
2 * Copyright (c) 2013 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Ioana Grigoropol(Intel) - initial API and implementation
10 *******************************************************************************/
11package org.yocto.bc.remote.utils;
12
13import java.io.IOException;
14import java.io.Writer;
15
16public class ConsoleWriter extends Writer {
17
18 private StringBuffer sb;
19
20 public ConsoleWriter() {
21 sb = new StringBuffer();
22 }
23
24 @Override
25 public void close() throws IOException {
26 }
27
28 public String getContents() {
29 return sb.toString();
30 }
31
32 @Override
33 public void flush() throws IOException {
34 }
35
36 @Override
37 public void write(char[] cbuf, int off, int len) throws IOException {
38 sb.append(cbuf);
39 }
40
41 @Override
42 public void write(String str) throws IOException {
43 sb.append(str);
44 }
45
46}