Package i2p.susi.util
Class RegexOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
i2p.susi.util.RegexOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Replace patterns with a simple regex on the fly.
Case insensitive.
- Since:
- 0.9.62
-
Field Summary
FieldsFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionRegexOutputStream(OutputStream out, String pattern, String replace, String onNoMatch) -
Method Summary
Methods inherited from class java.io.FilterOutputStream
flush, write, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
idx
int idx
-
-
Constructor Details
-
RegexOutputStream
- Parameters:
out- MUST be buffered because this writes one byte at a timepattern- the only special char recognized is '*' and cannot be at the beginning or end or have two in a row. ASCII-only, no UTF-8.replace- ASCII-only, no UTF-8.onNoMatch- force output of this at the end if no replacement made, or null
-
-
Method Details
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
main
- Throws:
Exception
-