EXIficient

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

java.lang.Object
  extended by com.siemens.ct.exi.io.channel.AbstractEncoderChannel
      extended by com.siemens.ct.exi.io.channel.ByteEncoderChannel
All Implemented Interfaces:
EncoderChannel

public final class ByteEncoderChannel
extends AbstractEncoderChannel
implements EncoderChannel

TODO Description

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

Constructor Summary
ByteEncoderChannel(java.io.OutputStream os)
          Construct a byte aligned encoder from output stream.
 
Method Summary
 void encode(byte[] b, int off, int len)
           
 void encode(int b)
           
 void encodeBoolean(boolean b)
          Encode a single boolean value.
 void encodeNBitUnsignedInteger(int b, int n)
          Encode n-bit unsigned integer using the minimum number of bytes required to store n bits.
 void flush()
           
 java.io.OutputStream getOutputStream()
           
 
Methods inherited from class com.siemens.ct.exi.io.channel.AbstractEncoderChannel
encodeBinary, encodeBinary, encodeBoolean, encodeDateTime, encodeDateTime, encodeDecimal, encodeDecimal, encodeFloat, encodeFloat, encodeInteger, encodeInteger, encodeInteger, encodeInteger, encodeString, encodeStringOnly, encodeUnsignedInteger, encodeUnsignedInteger, getNumberOfChannelValues, incrementValues
 
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
encodeBinary, encodeBinary, encodeBoolean, encodeDateTime, encodeDateTime, encodeDecimal, encodeDecimal, encodeFloat, encodeFloat, encodeInteger, encodeInteger, encodeInteger, encodeInteger, encodeString, encodeStringOnly, encodeUnsignedInteger, encodeUnsignedInteger, getNumberOfChannelValues, incrementValues
 

Constructor Detail

ByteEncoderChannel

public ByteEncoderChannel(java.io.OutputStream os)
Construct a byte aligned encoder from output stream.

Method Detail

getOutputStream

public java.io.OutputStream getOutputStream()
Specified by:
getOutputStream in interface EncoderChannel

flush

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

encode

public void encode(int b)
            throws java.io.IOException
Specified by:
encode in interface EncoderChannel
Throws:
java.io.IOException

encode

public void encode(byte[] b,
                   int off,
                   int len)
            throws java.io.IOException
Specified by:
encode in interface EncoderChannel
Throws:
java.io.IOException

encodeBoolean

public void encodeBoolean(boolean b)
                   throws java.io.IOException,
                          java.lang.IllegalArgumentException
Encode a single boolean value. A false value is encoded as byte 0 and true value is encode as byte 1.

Specified by:
encodeBoolean in interface EncoderChannel
Throws:
java.io.IOException
java.lang.IllegalArgumentException

encodeNBitUnsignedInteger

public void encodeNBitUnsignedInteger(int b,
                                      int n)
                               throws java.io.IOException
Encode n-bit unsigned integer using the minimum number of bytes required to store n bits. The n least significant bits of parameter b starting with the most significant, i.e. from left to right.

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

EXIficient