com.ibm.streams.operator.encoding

Interface BinaryEncoding



  • public interface BinaryEncoding
    Interface to encode and decode Tuples into a binary encoding. Instances of BinaryEncoding are not thread safe. Applications may create an instance for each thread or synchronize access to a BinaryEncoding instance.
    Since:
    InfoSphere® Streams Version 3.0
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      Tuple decodeTuple(java.nio.ByteBuffer buffer)
      Decode a encoded tuple from buffer and return it as an immutable Tuple.
      void encodeTuple(Tuple tuple, java.nio.ByteBuffer buffer)
      Encode tuple into buffer using this encoding.
      long getEncodedSize(Tuple tuple)
      Get the maximum number of bytes required to write out a binary encoded version of a tuple using this encoding.
    • Method Detail

      • getEncodedSize

        long getEncodedSize(Tuple tuple)
        Get the maximum number of bytes required to write out a binary encoded version of a tuple using this encoding.
        Parameters:
        tuple - Tuple to be encoded.
        Returns:
        Maximum number of bytes required to encode tuple.
      • encodeTuple

        void encodeTuple(Tuple tuple,
                       java.nio.ByteBuffer buffer)
        Encode tuple into buffer using this encoding. For tuple to be successfully encoded buffer.remaining() must return at least the number of bytes returned by getEncodedSize(Tuple);
        Parameters:
        tuple - Tuple to be encoded.
        buffer - Buffer to hold encoded tuple.
      • decodeTuple

        Tuple decodeTuple(java.nio.ByteBuffer buffer)
        Decode a encoded tuple from buffer and return it as an immutable Tuple.
        Parameters:
        buffer - Buffer containing encoded tuple.
        Returns:
        Tuple instance decoded from buffer.