EXIficient

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

java.lang.Object
  extended by com.siemens.ct.exi.io.channel.AbstractEncoderChannel
All Implemented Interfaces:
EncoderChannel
Direct Known Subclasses:
BitEncoderChannel, ByteEncoderChannel

public abstract class AbstractEncoderChannel
extends java.lang.Object
implements EncoderChannel

TODO Description

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

Constructor Summary
AbstractEncoderChannel()
           
 
Method Summary
 void encodeBigInteger(java.math.BigInteger bi)
           
 void encodeBinary(byte[] b)
          Encode a binary value as a length-prefixed sequence of octets.
 void encodeBoolean(XSDBoolean b)
           
 void encodeDateTime(java.util.Calendar cal, DatetimeType type)
          Encode Date-Time as a sequence of values representing the individual components of the Date-Time.
 void encodeDateTime(XSDDatetime datetime)
           
 void encodeDecimal(java.math.BigDecimal decimal)
          Encode a decimal represented as a Boolean sign followed by two Unsigned Integers.
 void encodeDecimal(boolean negative, java.math.BigInteger integral, java.math.BigInteger reverseFraction)
           
 void encodeDouble(double d)
           
 void encodeDouble(long mantissa, long exponent)
           
 void encodeFloat(float f)
          Encode a Double represented as two consecutive Integers.
 void encodeFloat(int mantissa, int exponent)
           
 void encodeInteger(int n)
          Encode an arbitrary precision integer using a sign bit followed by a sequence of octets.
 void encodeLong(long l)
           
 void encodeString(java.lang.String s)
          Encode a string as a length-prefixed sequence of UCS codepoints, each of which is encoded as an integer.
 void encodeStringOnly(java.lang.String s)
          Encode a string as a sequence of UCS codepoints, each of which is encoded as an integer.
 void encodeUnsignedBigInteger(java.math.BigInteger bi)
           
 void encodeUnsignedInteger(int n)
          Encode an arbitrary precision non negative integer using a sequence of octets.
 void encodeUnsignedLong(long l)
           
 
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.EncoderChannel
align, encode, encode, encodeBoolean, encodeNBitUnsignedInteger, flush, getOutputStream
 

Constructor Detail

AbstractEncoderChannel

public AbstractEncoderChannel()
Method Detail

encodeBinary

public void encodeBinary(byte[] b)
                  throws java.io.IOException
Encode a binary value as a length-prefixed sequence of octets.

Specified by:
encodeBinary in interface EncoderChannel
Throws:
java.io.IOException

encodeBoolean

public void encodeBoolean(XSDBoolean b)
                   throws java.io.IOException,
                          java.lang.IllegalArgumentException
Specified by:
encodeBoolean in interface EncoderChannel
Throws:
java.io.IOException
java.lang.IllegalArgumentException

encodeString

public void encodeString(java.lang.String s)
                  throws java.io.IOException
Encode 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:
encodeString in interface EncoderChannel
Throws:
java.io.IOException

encodeStringOnly

public void encodeStringOnly(java.lang.String s)
                      throws java.io.IOException
Description copied from interface: EncoderChannel
Encode a string as a 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:
encodeStringOnly in interface EncoderChannel
Throws:
java.io.IOException

encodeInteger

public void encodeInteger(int n)
                   throws java.io.IOException
Encode 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:
encodeInteger in interface EncoderChannel
Throws:
java.io.IOException

encodeLong

public void encodeLong(long l)
                throws java.io.IOException
Specified by:
encodeLong in interface EncoderChannel
Throws:
java.io.IOException

encodeBigInteger

public void encodeBigInteger(java.math.BigInteger bi)
                      throws java.io.IOException
Specified by:
encodeBigInteger in interface EncoderChannel
Throws:
java.io.IOException

encodeUnsignedInteger

public void encodeUnsignedInteger(int n)
                           throws java.io.IOException
Encode 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:
encodeUnsignedInteger in interface EncoderChannel
Throws:
java.io.IOException

encodeUnsignedLong

public void encodeUnsignedLong(long l)
                        throws java.io.IOException
Specified by:
encodeUnsignedLong in interface EncoderChannel
Throws:
java.io.IOException

encodeUnsignedBigInteger

public void encodeUnsignedBigInteger(java.math.BigInteger bi)
                              throws java.io.IOException
Specified by:
encodeUnsignedBigInteger in interface EncoderChannel
Throws:
java.io.IOException

encodeDecimal

public void encodeDecimal(java.math.BigDecimal decimal)
                   throws java.io.IOException
Encode 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:
encodeDecimal in interface EncoderChannel
Throws:
java.io.IOException

encodeDecimal

public void encodeDecimal(boolean negative,
                          java.math.BigInteger integral,
                          java.math.BigInteger reverseFraction)
                   throws java.io.IOException,
                          java.lang.RuntimeException
Specified by:
encodeDecimal in interface EncoderChannel
Throws:
java.io.IOException
java.lang.RuntimeException

encodeFloat

public void encodeFloat(float f)
                 throws java.io.IOException
Encode a Double 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:
encodeFloat in interface EncoderChannel
Throws:
java.io.IOException

encodeFloat

public void encodeFloat(int mantissa,
                        int exponent)
                 throws java.io.IOException
Specified by:
encodeFloat in interface EncoderChannel
Throws:
java.io.IOException

encodeDouble

public void encodeDouble(double d)
                  throws java.io.IOException
Specified by:
encodeDouble in interface EncoderChannel
Throws:
java.io.IOException

encodeDouble

public void encodeDouble(long mantissa,
                         long exponent)
                  throws java.io.IOException
Specified by:
encodeDouble in interface EncoderChannel
Throws:
java.io.IOException

encodeDateTime

public void encodeDateTime(java.util.Calendar cal,
                           DatetimeType type)
                    throws java.io.IOException
Encode Date-Time as a sequence of values representing the individual components of the Date-Time.

Specified by:
encodeDateTime in interface EncoderChannel
Throws:
java.io.IOException

encodeDateTime

public void encodeDateTime(XSDDatetime datetime)
                    throws java.io.IOException
Specified by:
encodeDateTime in interface EncoderChannel
Throws:
java.io.IOException

EXIficient