Using untyped read

1 post / 0 new
Offline
Last seen: 1 year 7 months ago
Joined: 07/12/2012
Posts: 51
Using untyped read

The Java API documentation for read_untyped is:

void read_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, int sample_states, int view_states, int instance_states)

What is the approprate type to  use for the received_data parameter ?

 List<T> dataSeq = new ArrayList<>(); does not work. It throws this exception. The list has an initial length of 0, but

so does any FooSeq.

Exception in thread "main" java.lang.IllegalStateException: expected sequence of length 1642; found 0
at com.rti.dds.subscription.DataReaderDelegateImpl.pull_data_sequence_from_native(Unknown Source)
at com.rti.dds.subscription.DataReaderImpl.read_or_take_untypedI(Unknown Source)
at com.rti.dds.subscription.DataReaderImpl.read_or_take_untypedI(Unknown Source)
at com.rti.dds.subscription.DataReaderImpl.read_untyped(Unknown Source)
at com.joy.fb20.da.ddsaccess.DaAIGeneric.read_io(DaAIGeneric.java:311)
at com.joy.fb20.da.main.DaTestClass.testSoFar3(DaTestClass.java:335)
at com.joy.fb20.da.main.DaTestClass.main(DaTestClass.java:66)

 

Thanks

Nico.

 

Organization: