001
014
015 package com.liferay.util.bridges.jsf.sun;
016
017 import java.io.IOException;
018 import java.io.Writer;
019
020
023 public class WriterWrapper extends Writer {
024
025 public WriterWrapper(Writer writer) {
026 _writer = writer;
027 }
028
029 @Override
030 public void close() throws IOException {
031 _writer.close();
032 }
033
034 @Override
035 public void flush() {
036 }
037
038 public void write(char cbuf) throws IOException {
039 _writer.write(cbuf);
040 }
041
042 @Override
043 public void write(char[] cbuf, int off, int len) throws IOException {
044 StringBuilder sb = new StringBuilder(len);
045
046 sb.append(cbuf, off, len);
047
048 _writer.write(sb.toString());
049 }
050
051 @Override
052 public void write(int c) throws IOException {
053 _writer.write(c);
054 }
055
056 @Override
057 public void write(String str) throws IOException {
058 _writer.write(str);
059 }
060
061 @Override
062 public void write(String str, int off, int len) throws IOException {
063 _writer.write(str, off, len);
064 }
065
066 private Writer _writer;
067
068 }