com.ibm.streams.operator.encoding
Interface BinaryEncoding
-
public interface BinaryEncodingInterface to encode and decode Tuples into a binary encoding. Instances ofBinaryEncodingare not thread safe. Applications may create an instance for each thread or synchronize access to aBinaryEncodinginstance.- Since:
- InfoSphere® Streams Version 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description TupledecodeTuple(java.nio.ByteBuffer buffer)Decode a encoded tuple frombufferand return it as an immutableTuple.voidencodeTuple(Tuple tuple, java.nio.ByteBuffer buffer)Encodetupleintobufferusing this encoding.longgetEncodedSize(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)
Encodetupleintobufferusing this encoding. Fortupleto be successfully encodedbuffer.remaining()must return at least the number of bytes returned bygetEncodedSize(Tuple);- Parameters:
tuple- Tuple to be encoded.buffer- Buffer to hold encoded tuple.
-
-