com.ibm.streams.operator.encoding
Interface BinaryEncoding
-
public interface BinaryEncoding
Interface to encode and decode Tuples into a binary encoding. Instances ofBinaryEncoding
are not thread safe. Applications may create an instance for each thread or synchronize access to aBinaryEncoding
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 frombuffer
and return it as an immutableTuple
.void
encodeTuple(Tuple tuple, java.nio.ByteBuffer buffer)
Encodetuple
intobuffer
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)
Encodetuple
intobuffer
using this encoding. Fortuple
to 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.
-
-