@Internal public class ReplacingInputStream extends java.io.FilterInputStream
| Constructor and Description |
|---|
ReplacingInputStream(java.io.InputStream in,
byte[] pattern,
byte[] replacement)
Replace occurrences of pattern in the input.
|
ReplacingInputStream(java.io.InputStream in,
java.lang.String pattern,
java.lang.String replacement)
Replace occurrences of pattern in the input.
|
| Modifier and Type | Method and Description |
|---|---|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
java.lang.String |
toString() |
public ReplacingInputStream(java.io.InputStream in,
java.lang.String pattern,
java.lang.String replacement)
in - inputpattern - pattern to replace.replacement - the replacement or nullpublic ReplacingInputStream(java.io.InputStream in,
byte[] pattern,
byte[] replacement)
If you want to normalize line endings DOS/MAC (\n\r | \r) to UNIX (\n), you can call the following:
new ReplacingInputStream(new ReplacingInputStream(is, "\n\r", "\n"), "\r", "\n")
in - inputpattern - pattern to replacereplacement - the replacement or nullpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright 2018 The Apache Software Foundation or its licensors, as applicable.