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
ConstructorDescriptionBijectiveOutputStream
(OutputStream aOutputStream, org.refcodes.numerical.BijectiveFunction<Byte, Byte> aBijectiveFunction) Constructs theBijectiveOutputStream
by wrapping the givenOutputStream
for the providedBijectiveFunction
to be applied on the bytes to be written. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Constructor Details
-
BijectiveOutputStream
public BijectiveOutputStream(OutputStream aOutputStream, org.refcodes.numerical.BijectiveFunction<Byte, Byte> aBijectiveFunction) Constructs theBijectiveOutputStream
by wrapping the givenOutputStream
for the providedBijectiveFunction
to be applied on the bytes to be written.- Parameters:
aOutputStream
- TheOutputStream
to be wrapped.aBijectiveFunction
- TheBijectiveFunction
to be applied to the bytes to be written.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
equals
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
hashCode
public int hashCode() -
toString
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-