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
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionRegexOutputStream
(OutputStream out, String pattern, String replace, String onNoMatch) -
Method Summary
Methods inherited from class java.io.FilterOutputStream
flush, write, write
Methods 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:
write
in classFilterOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
main
- Throws:
Exception
-