@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
- input
(in - 输入)
pattern
- pattern to replace.
(pattern - 要替换的模式。)
replacement
- the replacement or null
(替换 - 替换或 null)
public 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
- input
(in - 输入)
pattern
- pattern to replace
(pattern - 要替换的模式)
replacement
- the replacement or null
(替换 - 替换或 null)
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class
java.io.FilterInputStream
java.io.IOException
(java.io.IOException)
public int read(byte[] b) throws java.io.IOException
read
in class
java.io.FilterInputStream
java.io.IOException
(java.io.IOException)
public int read() throws java.io.IOException
read
in class
java.io.FilterInputStream
java.io.IOException
(java.io.IOException)
public java.lang.String toString()
toString
in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.