Class BijectiveOutputStream
java.lang.Object
java.io.OutputStream
org.refcodes.io.BijectiveOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
A
BijectiveOutputStream wraps an OutputStream and produces
output bytes by applying a BijectiveFunction on each byte to be
written before delegating the processed vale to the given
OutputStream. The output of the BijectiveOutputStream can be
converted back by the according InverseInputStream.-
Constructor Summary
ConstructorsConstructorDescriptionBijectiveOutputStream(OutputStream aOutputStream, org.refcodes.numerical.BijectiveFunction<Byte, Byte> aBijectiveFunction) Constructs theBijectiveOutputStreamby wrapping the givenOutputStreamfor the providedBijectiveFunctionto be applied on the bytes to be written. -
Method Summary
Methods inherited from class OutputStream
nullOutputStream, write, write
-
Constructor Details
-
BijectiveOutputStream
public BijectiveOutputStream(OutputStream aOutputStream, org.refcodes.numerical.BijectiveFunction<Byte, Byte> aBijectiveFunction) Constructs theBijectiveOutputStreamby wrapping the givenOutputStreamfor the providedBijectiveFunctionto be applied on the bytes to be written.- Parameters:
aOutputStream- TheOutputStreamto be wrapped.aBijectiveFunction- TheBijectiveFunctionto be applied to the bytes to be written.
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
equals
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
hashCode
-
toString
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-