java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
com.aoapps.servlet.filter.TrimFilterOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Filters the output and removes extra white space at the beginning of lines and completely removes blank lines.
TEXTAREAs are automatically detected as long as they start with exact "<textarea" and end with exactly "</textarea" (case insensitive).
PREs are automatically detected as long as they start with exact "<pre" and end with exactly "</pre" (case insensitive).
The reason for the specific tag format is to simplify the implementation
for maximum performance. Careful attention has been paid to minimize the internal buffering in this class. As many write/print operations as possible
are passed directly to the wrapped
ServletOutputStream. Please note that these methods are not synchronized, as servlet output is normally written
by the thread allocated for the request. If synchronization is required it should be provided externally.- Author:
- AO Industries, Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionTrimFilterOutputStream(ServletOutputStream wrapped, ServletResponse response) Creates a newTrimFilterOutputStream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()booleanisReady()voidprint(boolean b) voidprint(char c) voidprint(double d) voidprint(float f) voidprint(int i) voidprint(long l) voidvoidprintln()voidprintln(boolean b) voidprintln(char c) voidprintln(double d) voidprintln(float f) voidprintln(int i) voidprintln(long l) voidvoidvoidwrite(byte[] b) voidwrite(byte[] buf, int off, int len) voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
TrimFilterOutputStream
Creates a newTrimFilterOutputStream.
-
-
Method Details
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classServletOutputStream- Throws:
IOException
-
isReady
public boolean isReady()- Specified by:
isReadyin classServletOutputStream
-
setWriteListener
- Specified by:
setWriteListenerin classServletOutputStream
-
