Package com.github.jinahya.bit.io
Class DefaultBitInput
- java.lang.Object
-
- com.github.jinahya.bit.io.AbstractBitInput
-
- com.github.jinahya.bit.io.DefaultBitInput
-
- All Implemented Interfaces:
BitInput
public class DefaultBitInput extends AbstractBitInput
- Author:
- Jin Kwon <jinahya_at_gmail.com>
-
-
Constructor Summary
Constructors Constructor Description DefaultBitInput(ByteInput delegate)
Create a new instance with specified delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteInput
getDelegate()
Returns the current value ofdelegate
.protected int
read()
Reads an unsigned 8-bit integer.void
setDelegate(ByteInput delegate)
Replaces the value ofdelegate
with given.String
toString()
Returns a string representation of the object.-
Methods inherited from class com.github.jinahya.bit.io.AbstractBitInput
align, getCount, readBoolean, readByte, readChar, readInt, readLong, readShort, unsigned16, unsigned8
-
-
-
-
Method Detail
-
toString
public String toString()
Returns a string representation of the object.- Overrides:
toString
in classAbstractBitInput
- Returns:
- a string representation of the object.
-
read
protected int read() throws IOException
Reads an unsigned 8-bit integer. Theread()
method ofDefaultBitInput
class invokesByteInput.read()
,on whatgetDelegate()
method returns, and returns the result.- Specified by:
read
in classAbstractBitInput
- Returns:
- an unsigned 8-bit integer.
- Throws:
IOException
- if an I/O error occurs.
-
getDelegate
public ByteInput getDelegate()
Returns the current value ofdelegate
.- Returns:
- current value of
delegate
-
-