java.lang.Object
java.io.InputStream
org.refcodes.io.InverseInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
A
InverseInputStream wraps an InputStream and consumes input
bytes by applying a InverseFunction on each byte read from the
provided InputStream before passing back the processed byte to the
caller. The input of the InverseInputStream can be converted back by
the according BijectiveOutputStream.-
Constructor Summary
ConstructorsConstructorDescriptionInverseInputStream(InputStream aInputStream, org.refcodes.numerical.InverseFunction<Byte, Byte> aInverseFunction) Constructs theInverseInputStreamby wrapping the givenInputStreamfor the providedInverseFunctionto be applied on the bytes to be read. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
InverseInputStream
public InverseInputStream(InputStream aInputStream, org.refcodes.numerical.InverseFunction<Byte, Byte> aInverseFunction) Constructs theInverseInputStreamby wrapping the givenInputStreamfor the providedInverseFunctionto be applied on the bytes to be read.- Parameters:
aInputStream- TheInputStreamto be wrapped.aInverseFunction- TheInverseFunctionto be applied to the bytes to be read.
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
mark
public void mark(int aReadlimit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
toString
-