/**
* Convert saved context to stream for parsing
* @return stream from saved content
*/
public Reader getContentAsReader() {
FastBufferReader result = null;
String encoding = this.getCharacterEncoding() ;
/// String content;
if (isUseWriter()) {
printWriter.flush();
printWriter.close();
result = new FastBufferReader(stringWriter);
/// content = stringWriter.toString();
} else if (isUseStream()) {
try {
servletOutputStream.flush();
} catch (IOException ex) {
log.warn(Messages.getMessage(Messages.FLUSH_BUFFERED_STREAM_ERROR), ex);
}
try {
FastBufferWriter writer = byteStream.convertToWriter(encoding);
result = new FastBufferReader(writer);
/// content = byteStream.toString(encoding);
} catch (UnsupportedEncodingException e) {
log.warn(Messages.getMessage(Messages.UNSUPPORTED_ENCODING_WARNING_2), e);
FastBufferWriter writer = byteStream.convertToWriter();
result = new FastBufferReader(writer);
/// content = byteStream.toString();
}
} else {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.NO_WRITER_CALLED_INFO));