Size of Octet/byte RTI 6.0.0

2 posts / 0 new
Last post
Last seen: 1 year 4 weeks ago
Joined: 07/26/2019
Posts: 4
Size of Octet/byte RTI 6.0.0

Environment  64 bit Java on centOS 7.x and RTI 6.0.0 evaluation version

I have the following in a Messages.idl

module binary {
   struct DDSBinaryMsg {
   long pubNumber; //@key
   long long pubTime;
   long fileIndex;
   long long CRC32;
   sequence<octet> image;

and use the following to generate to code

rtiddsgen -language Java -replace -package RTIMessages -unboundedSupport-example x64Linux3gcc4.8.2 RTIMessages.idl

In brief, I am selecting an image file for a directory and send it (along with a calculated CRC32) The jpg or png is loaded into the sequence<octet>.

Comparing the size of the file on disk, and the byte[] array lenght with  DDSBinaryMsg object ddsMsg or

ddsMsg.image.size() the ddsMsg size is always twice the size on the byte array

So, may question is "What is the size (number of bits) in an octet.?"

Found this - which appears I it might be 8 bit byte vs UTF-8 typer of issue?'s%2520New%2520in%25205.3.0%7C_____8

Thanks for any help


Last seen: 1 year 4 weeks ago
Joined: 07/26/2019
Posts: 4

Never mind. solved it.

Varible declaration:   DDSBinaryMsg ddsMsg = new DDSBinaryMsg();

and image is declared a ByteSeq

Incorrect code: ddsMsg.image.addAllByte (binaryElement.getBinaryData());

Correct code:  ddsMsg.image.setByte(0, binaryElement.getBinaryData(), 0, imageLen);