Class LineEndNormalizingWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.glassfish.admin.rest.logviewer.LineEndNormalizingWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class LineEndNormalizingWriter extends FilterWriter
Finds the lone LF and converts that to CR+LF.Internet Explorer's XmlHttpRequest.responseText seems to normalize the line end, and if we only send LF without CR, it will not recognize that as a new line. To work around this problem, we use this filter to always convert LF to CR+LF.
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Constructor Description LineEndNormalizingWriter(Writer out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
void
write(int c)
void
write(String str)
void
write(String str, int off, int len)
-
Methods inherited from class java.io.FilterWriter
close, flush
-
Methods inherited from class java.io.Writer
append, append, append, nullWriter
-
-
-
-
Constructor Detail
-
LineEndNormalizingWriter
public LineEndNormalizingWriter(Writer out)
-
-
Method Detail
-
write
public void write(char[] cbuf) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(int c) throws IOException
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
-