public class BitDecoderChannel extends AbstractDecoderChannel implements DecoderChannel
BitInputStream.
Reading a single bit from the underlying stream involves several VM
operations. Thus, whenever possible, whole bytes should be read instead.| Modifier and Type | Field and Description |
|---|---|
protected BitInputStream |
istream
Underlying bit input stream from which bits and bytes are read.
|
sbHelper| Constructor and Description |
|---|
BitDecoderChannel(InputStream is)
Construct a decoder from input stream
|
| Modifier and Type | Method and Description |
|---|---|
void |
align()
Align to next byte-aligned boundary in the stream if it is not already at
such a boundary
|
int |
decode()
Decodes a single byte
|
byte[] |
decodeBinary()
Decode a binary value as a length-prefixed sequence of octets.
|
boolean |
decodeBoolean()
Decode a single boolean value.
|
int |
decodeNBitUnsignedInteger(int n)
Decodes and returns an n-bit unsigned integer.
|
int |
lookAhead() |
void |
skip(long n)
Skips over and discards
n bytes of data from this channel. |
decodeBooleanValue, decodeDateTimeValue, decodeDecimalValue, decodeFloatValue, decodeInteger, decodeIntegerValue, decodeLong, decodeNBitUnsignedIntegerValue, decodeString, decodeStringOnly, decodeUnsignedInteger, decodeUnsignedIntegerValue, decodeUnsignedIntegerValue, decodeUnsignedLongclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecodeBooleanValue, decodeDateTimeValue, decodeDecimalValue, decodeFloatValue, decodeIntegerValue, decodeNBitUnsignedIntegerValue, decodeString, decodeStringOnly, decodeUnsignedInteger, decodeUnsignedIntegerValueprotected BitInputStream istream
public BitDecoderChannel(InputStream is)
is - input streampublic final int decode()
throws IOException
DecoderChanneldecode in interface DecoderChannelIOException - IO exceptionpublic void align()
throws IOException
DecoderChannelalign in interface DecoderChannelIOException - IO exceptionpublic int lookAhead()
throws IOException
IOExceptionpublic void skip(long n)
throws IOException
DecoderChanneln bytes of data from this channel.skip in interface DecoderChanneln - number of bytes to skipIOException - IO exceptionpublic final int decodeNBitUnsignedInteger(int n)
throws IOException
decodeNBitUnsignedInteger in interface DecoderChanneln - number of bitsIOException - IO exceptionpublic boolean decodeBoolean()
throws IOException
decodeBoolean in interface DecoderChannelIOException - IO exceptionpublic byte[] decodeBinary()
throws IOException
decodeBinary in interface DecoderChannelIOException - IO exceptionCopyright © 2018 Siemens AG. All rights reserved.