- java.lang.Object
-
- java.io.OutputStream
-
- org.refcodes.codec.BaseEncoderOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class BaseEncoderOutputStream extends OutputStream
TheBaseEncoderOutputStreamis an implementations of theBaseEncoderinterface to be used withOutputStreaminstances. Make sure to callclose()when done as the final padding bytes are appended to the end!
-
-
Constructor Summary
Constructors Constructor Description BaseEncoderOutputStream(OutputStream aOutputStream, BaseMetrics aBaseMetrics)Constructs aBaseEncoderOutputStreamusing the givenOutputStreamfrom which to read decoded data and using theBaseMetricsto encode the data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Make sure to callclose()when done as the final padding bytes are appended to the end!voidflush()voidwrite(int aByte)-
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
-
-
-
Constructor Detail
-
BaseEncoderOutputStream
public BaseEncoderOutputStream(OutputStream aOutputStream, BaseMetrics aBaseMetrics) throws IOException
Constructs aBaseEncoderOutputStreamusing the givenOutputStreamfrom which to read decoded data and using theBaseMetricsto encode the data.- Parameters:
aOutputStream- TheOutputStreamfrom which to read decoded data.aBaseMetrics- TheBaseMetricsto use to encode the encoded data.- Throws:
IOException- throw in case using theOutputStreamcaused I/O related problems.
-
-
Method Detail
-
write
public void write(int aByte) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
public void close() throws IOExceptionMake sure to callclose()when done as the final padding bytes are appended to the end!- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
-