java.lang.Object
java.io.InputStream
org.refcodes.io.ReplaceInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
The
ReplaceInputStream replaces a give byte sequence with another
given bytes sequence.-
Constructor Summary
ConstructorsConstructorDescriptionReplaceInputStream(InputStream aInputStream, byte[] aFindBytes, byte[] aReplaceBytes) Constructs aReplaceInputStreamfrom the givenInputStreamreplacing given bytes with replacement bytes.ReplaceInputStream(InputStream aInputStream, String aFindBytes, String aReplaceBytes) Constructs aReplaceInputStreamfrom the givenInputStreamreplacing given bytes with replacement bytes.ReplaceInputStream(InputStream aInputStream, String aFindBytes, String aReplaceBytes, Charset aCharset) Constructs aReplaceInputStreamfrom the givenInputStreamreplacing given bytes with replacement bytes. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
ReplaceInputStream
Constructs aReplaceInputStreamfrom the givenInputStreamreplacing given bytes with replacement bytes.- Parameters:
aInputStream- TheInputStreamto be manipulated accordingly.aFindBytes- The bytes to replace.aReplaceBytes- The replacement bytes.
-
ReplaceInputStream
Constructs aReplaceInputStreamfrom the givenInputStreamreplacing given bytes with replacement bytes.- Parameters:
aInputStream- TheInputStreamto be manipulated accordingly.aFindBytes- TheStringcontaining the bytes to replace.aReplaceBytes- TheStringcontaining the replacement bytes.
-
ReplaceInputStream
public ReplaceInputStream(InputStream aInputStream, String aFindBytes, String aReplaceBytes, Charset aCharset) Constructs aReplaceInputStreamfrom the givenInputStreamreplacing given bytes with replacement bytes.- Parameters:
aInputStream- TheInputStreamto be manipulated accordingly.aFindBytes- TheStringcontaining the bytes to replace.aReplaceBytes- TheStringcontaining the replacement bytes.aCharset- TheCharsetto be used when converting the providedStringtexts into bytes.
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int aReadlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-