GuideDecoratedWriter.java
1.17 KB
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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.aemds.guide.utils;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
class GuideDecoratedWriter
extends Writer {
private final Writer delegatedJspWriter;
private boolean writeToJsp;
private final StringWriter writerForCache = new StringWriter();
public Writer getdelegatedJspWriter() {
return this.delegatedJspWriter;
}
public GuideDecoratedWriter(Writer delegatedJspWriter, boolean writeToJsp) {
this.delegatedJspWriter = delegatedJspWriter;
this.writeToJsp = writeToJsp;
}
public String getHTMLToCache() {
return this.writerForCache.toString();
}
public void write(char[] cbuf, int off, int len) throws IOException {
if (this.writeToJsp) {
this.delegatedJspWriter.write(cbuf, off, len);
}
this.writerForCache.write(cbuf, off, len);
}
public void flush() throws IOException {
this.delegatedJspWriter.flush();
this.writerForCache.flush();
}
public void close() throws IOException {
this.delegatedJspWriter.close();
this.writerForCache.close();
}
}