EXIficient

com.siemens.ct.exi.io.channel
Class BitDecoderChannel

java.lang.Object
  extended by com.siemens.ct.exi.io.channel.AbstractDecoderChannel
      extended by com.siemens.ct.exi.io.channel.BitDecoderChannel
All Implemented Interfaces:
DecoderChannel

public class BitDecoderChannel
extends AbstractDecoderChannel
implements DecoderChannel

Simple datatype decoder based on an underlying BitInputStream. Reading a single bit from the underlying stream involves several VM operations. Thus, whenever possible, whole bytes should be read instead.

Version:
0.4.20081111
Author:
Daniel.Peintner.EXT@siemens.com, Joerg.Heuer@siemens.com

Constructor Summary
BitDecoderChannel(java.io.InputStream is)
          Construct a decoder from input stream
 
Method Summary
 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
 BinaryValue 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.
 
Methods inherited from class com.siemens.ct.exi.io.channel.AbstractDecoderChannel
decodeBooleanValue, decodeDateTimeValue, decodeDecimalValue, decodeDoubleValue, decodeFloatValue, decodeHugeIntegerValue, decodeIntegerValue, decodeLongValue, decodeNBitUnsignedIntegerValue, decodeString, decodeStringOnly, decodeUnsignedHugeIntegerValue, decodeUnsignedInteger, decodeUnsignedIntegerValue, decodeUnsignedLongValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.siemens.ct.exi.io.channel.DecoderChannel
decodeBooleanValue, decodeDateTimeValue, decodeDecimalValue, decodeDoubleValue, decodeFloatValue, decodeHugeIntegerValue, decodeIntegerValue, decodeLongValue, decodeNBitUnsignedIntegerValue, decodeString, decodeStringOnly, decodeUnsignedHugeIntegerValue, decodeUnsignedInteger, decodeUnsignedIntegerValue, decodeUnsignedLongValue
 

Constructor Detail

BitDecoderChannel

public BitDecoderChannel(java.io.InputStream is)
Construct a decoder from input stream

Method Detail

align

public void align()
           throws java.io.IOException
Description copied from interface: DecoderChannel
Align to next byte-aligned boundary in the stream if it is not already at such a boundary

Specified by:
align in interface DecoderChannel
Throws:
java.io.IOException

decode

public int decode()
           throws java.io.IOException
Description copied from interface: DecoderChannel
Decodes a single byte

Specified by:
decode in interface DecoderChannel
Returns:
a byte as int
Throws:
java.io.IOException

decodeNBitUnsignedInteger

public int decodeNBitUnsignedInteger(int n)
                              throws java.io.IOException
Decodes and returns an n-bit unsigned integer.

Specified by:
decodeNBitUnsignedInteger in interface DecoderChannel
Throws:
java.io.IOException

decodeBoolean

public boolean decodeBoolean()
                      throws java.io.IOException
Decode a single boolean value. The value false is represented by the bit 0, and the value true is represented by the bit 1.

Specified by:
decodeBoolean in interface DecoderChannel
Throws:
java.io.IOException

decodeBinary

public BinaryValue decodeBinary()
                         throws java.io.IOException
Decode a binary value as a length-prefixed sequence of octets.

Specified by:
decodeBinary in interface DecoderChannel
Throws:
java.io.IOException

EXIficient