- java.lang.Object
-
- java.io.OutputStream
-
- org.refcodes.codec.BaseEncoderOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class BaseEncoderOutputStream extends OutputStream
TheBaseEncoderOutputStream
is an implementations of theBaseEncoder
interface to be used withOutputStream
instances. 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 aBaseEncoderOutputStream
using the givenOutputStream
from which to read decoded data and using theBaseMetrics
to encode the data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Make sure to callclose()
when done as the final padding bytes are appended to the end!void
flush()
void
write(int aByte)
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
-
-
-
Constructor Detail
-
BaseEncoderOutputStream
public BaseEncoderOutputStream(OutputStream aOutputStream, BaseMetrics aBaseMetrics) throws IOException
Constructs aBaseEncoderOutputStream
using the givenOutputStream
from which to read decoded data and using theBaseMetrics
to encode the data.- Parameters:
aOutputStream
- TheOutputStream
from which to read decoded data.aBaseMetrics
- TheBaseMetrics
to use to encode the encoded data.- Throws:
IOException
- throw in case using theOutputStream
caused I/O related problems.
-
-
Method Detail
-
write
public void write(int aByte) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
Make sure to callclose()
when done as the final padding bytes are appended to the end!- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
-