EXIficient

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

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

public class PreReadByteDecoderChannel
extends java.lang.Object
implements DecoderChannel

TODO Description

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

Constructor Summary
PreReadByteDecoderChannel(TypeDecoder decoder, ByteDecoderChannel bdc, ExpandedName qname, java.util.List<Datatype> datatypes, int occurrences)
           
 
Method Summary
 int decode()
          Decodes a single byte
 byte[] decodeBinary()
          Decode a binary value as a length-prefixed sequence of octets.
 java.lang.String decodeBinaryAsString()
           
 boolean decodeBoolean()
          Decode a single boolean value.
 java.lang.String decodeBooleanAsString()
           
 java.util.Calendar decodeDateTime(DatetimeType type)
          Decode Date-Time as sequence of values representing the individual components of the Date-Time.
 java.lang.String decodeDateTimeAsString(DatetimeType type)
           
 java.math.BigDecimal decodeDecimal()
          Decode a decimal represented as a Boolean sign followed by two Unsigned Integers.
 java.lang.String decodeDecimalAsString()
           
 int decodeEventCode(int characteristics)
           
 float decodeFloat()
          Decode a Float represented as two consecutive Integers.
 java.lang.String decodeFloatAsString()
           
 int decodeInteger()
          Decode an arbitrary precision integer using a sign bit followed by a sequence of octets.
 java.lang.String decodeIntegerAsString()
           
 int decodeNBitUnsignedInteger(int n)
          Decodes and returns an n-bit unsigned integer.
 java.lang.String decodeNBitUnsignedIntegerAsString(int n)
          Decodes and returns an n-bit unsigned integer as string.
 java.lang.String decodeString()
          Decode a string as a length-prefixed sequence of UCS codepoints, each of which is encoded as an integer.
 java.lang.String decodeStringOnly(int length)
          Decode the characters of a string whose length has already been read.
 int decodeUnsignedInteger()
          Decode an arbitrary precision non negative integer using a sequence of octets.
 long decodeUnsignedIntegerAsLong()
           
 java.lang.String decodeUnsignedIntegerAsString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreReadByteDecoderChannel

public PreReadByteDecoderChannel(TypeDecoder decoder,
                                 ByteDecoderChannel bdc,
                                 ExpandedName qname,
                                 java.util.List<Datatype> datatypes,
                                 int occurrences)
                          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

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

decodeBinary

public byte[] decodeBinary()
                    throws java.io.IOException
Description copied from interface: DecoderChannel
Decode a binary value as a length-prefixed sequence of octets.

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

decodeBinaryAsString

public java.lang.String decodeBinaryAsString()
                                      throws java.io.IOException
Specified by:
decodeBinaryAsString in interface DecoderChannel
Throws:
java.io.IOException

decodeBoolean

public boolean decodeBoolean()
                      throws java.io.IOException
Description copied from interface: DecoderChannel
Decode a single boolean value. The value false is represented by the bit (byte) 0, and the value true is represented by the bit (byte) 1.

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

decodeBooleanAsString

public java.lang.String decodeBooleanAsString()
                                       throws java.io.IOException
Specified by:
decodeBooleanAsString in interface DecoderChannel
Throws:
java.io.IOException

decodeDateTime

public java.util.Calendar decodeDateTime(DatetimeType type)
                                  throws java.io.IOException
Description copied from interface: DecoderChannel
Decode Date-Time as sequence of values representing the individual components of the Date-Time.

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

decodeDateTimeAsString

public java.lang.String decodeDateTimeAsString(DatetimeType type)
                                        throws java.io.IOException
Specified by:
decodeDateTimeAsString in interface DecoderChannel
Throws:
java.io.IOException

decodeDecimal

public java.math.BigDecimal decodeDecimal()
                                   throws java.io.IOException
Description copied from interface: DecoderChannel
Decode a decimal represented as a Boolean sign followed by two Unsigned Integers. A sign value of zero (0) is used to represent positive Decimal values and a sign value of one (1) is used to represent negative Decimal values The first Integer represents the integral portion of the Decimal value. The second positive integer represents the fractional portion of the decimal with the digits in reverse order to preserve leading zeros.

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

decodeDecimalAsString

public java.lang.String decodeDecimalAsString()
                                       throws java.io.IOException
Specified by:
decodeDecimalAsString in interface DecoderChannel
Throws:
java.io.IOException

decodeEventCode

public int decodeEventCode(int characteristics)
                    throws java.io.IOException
Throws:
java.io.IOException

decodeFloat

public float decodeFloat()
                  throws java.io.IOException
Description copied from interface: DecoderChannel
Decode a Float represented as two consecutive Integers. The first Integer represents the mantissa of the floating point number and the second Integer represents the 10-based exponent of the floating point number

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

decodeFloatAsString

public java.lang.String decodeFloatAsString()
                                     throws java.io.IOException
Specified by:
decodeFloatAsString in interface DecoderChannel
Throws:
java.io.IOException

decodeInteger

public int decodeInteger()
                  throws java.io.IOException
Description copied from interface: DecoderChannel
Decode an arbitrary precision integer using a sign bit followed by a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

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

decodeIntegerAsString

public java.lang.String decodeIntegerAsString()
                                       throws java.io.IOException
Specified by:
decodeIntegerAsString in interface DecoderChannel
Throws:
java.io.IOException

decodeNBitUnsignedInteger

public int decodeNBitUnsignedInteger(int n)
                              throws java.io.IOException
Description copied from interface: DecoderChannel
Decodes and returns an n-bit unsigned integer.

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

decodeNBitUnsignedIntegerAsString

public java.lang.String decodeNBitUnsignedIntegerAsString(int n)
                                                   throws java.io.IOException
Decodes and returns an n-bit unsigned integer as string.

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

decodeString

public java.lang.String decodeString()
                              throws java.io.IOException
Description copied from interface: DecoderChannel
Decode a string as a length-prefixed sequence of UCS codepoints, each of which is encoded as an integer. Look for codepoints of more than 16 bits that are represented as UTF-16 surrogate pairs in Java.

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

decodeStringOnly

public java.lang.String decodeStringOnly(int length)
                                  throws java.io.IOException
Description copied from interface: DecoderChannel
Decode the characters of a string whose length has already been read. Look for codepoints of more than 16 bits that are represented as UTF-16 surrogate pairs in Java.

Specified by:
decodeStringOnly in interface DecoderChannel
Parameters:
length - Length of the character sequence to read.
Returns:
The character sequence as a string.
Throws:
java.io.IOException

decodeUnsignedInteger

public int decodeUnsignedInteger()
                          throws java.io.IOException
Description copied from interface: DecoderChannel
Decode an arbitrary precision non negative integer using a sequence of octets. The most significant bit of the last octet is set to zero to indicate sequence termination. Only seven bits per octet are used to store the integer's value.

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

decodeUnsignedIntegerAsLong

public long decodeUnsignedIntegerAsLong()
                                 throws java.io.IOException
Specified by:
decodeUnsignedIntegerAsLong in interface DecoderChannel
Throws:
java.io.IOException

decodeUnsignedIntegerAsString

public java.lang.String decodeUnsignedIntegerAsString()
                                               throws java.io.IOException
Specified by:
decodeUnsignedIntegerAsString in interface DecoderChannel
Throws:
java.io.IOException

EXIficient