Package com.github.jinahya.bit.io
Class StreamByteOutput
- java.lang.Object
-
- com.github.jinahya.bit.io.AbstractByteOutput<OutputStream>
-
- com.github.jinahya.bit.io.StreamByteOutput
-
- All Implemented Interfaces:
ByteOutput
public class StreamByteOutput extends AbstractByteOutput<OutputStream>
A byte output writes bytes to anOutputStream
.- Author:
- Jin Kwon <onacit_at_gmail.com>
- See Also:
StreamByteInput
-
-
Field Summary
-
Fields inherited from class com.github.jinahya.bit.io.AbstractByteOutput
target
-
-
Constructor Summary
Constructors Constructor Description StreamByteOutput(OutputStream target)
Creates a new instance built on top of the specified output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(int value)
Writes given unsigned 8-bit value.-
Methods inherited from class com.github.jinahya.bit.io.AbstractByteOutput
getTarget, setTarget, toString
-
-
-
-
Constructor Detail
-
StreamByteOutput
public StreamByteOutput(OutputStream target)
Creates a new instance built on top of the specified output stream.- Parameters:
target
- the output stream;null
if it's supposed to be lazily initialized and set.
-
-
Method Detail
-
write
public void write(int value) throws IOException
Writes given unsigned 8-bit value. Thewrite(int)
method ofStreamByteOutput
class invokesOutputStream.write(int)
, on whatgetTarget()
method returns, with givenvalue
.- Parameters:
value
- an unsigned 8-bit value between0
and255
, both inclusive.- Throws:
IOException
- if an I/O error occurs.- See Also:
AbstractByteOutput.getTarget()
,OutputStream.write(int)
-
-